T
Tony Johansson
Hello!
Below I have four listing named (1),(2),(3) and (4)
The first one (1) is the listing for Default.aspx page that have
runat="server" on the form tag and made it
a HtmlForm control..
The second one (2) is the listing of the html code for the above
(1)Default.aspx that is send to the broswer on the client side.
The third (3) is the listings for the Default.aspx that have runat="server"
attribute removed.
The forth(4) is the listing of the html code for the above (3)Default.aspx
that is send to the brower on the client side.
Now to my question.
Why is no VIEWSTATE send to the browser when we have the runat="server"
attribute removed ?
You can see it for yourself in my listings below.
Default.aspx when we have runat="server" on the form tag
*******************************************
(1)
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs"
Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
Testing
</div>
</form>
</body>
</html>
(2)
This html code correspond to the above Default.aspx page.
This html code is sent to the browser on the client side
*******************************************
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>
Untitled Page
</title></head>
<body>
<form name="form1" method="post" action="Default.aspx" id="form1">
<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE"
value="/wEPDwUJNzgzNDMwNTMzZGSK/6SoraIMYhAyosKtnFrMdvLWXQ==" />
</div>
<div>
Testing
</div>
</form>
</body>
</html>
(3)
Default.aspx when we don't have runat="server" on the form tag
************************************************
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs"
Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1">
<div>
Testing
</div>
</form>
</body>
</html>
(4)
This html code correspond to the above Default.aspx page.
This html code is sent to the browser on the client side
********************************************
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>
Untitled Page
</title></head>
<body>
<form id="form1">
<div>
Testing
</div>
</form>
</body>
</html>
//Tony
Below I have four listing named (1),(2),(3) and (4)
The first one (1) is the listing for Default.aspx page that have
runat="server" on the form tag and made it
a HtmlForm control..
The second one (2) is the listing of the html code for the above
(1)Default.aspx that is send to the broswer on the client side.
The third (3) is the listings for the Default.aspx that have runat="server"
attribute removed.
The forth(4) is the listing of the html code for the above (3)Default.aspx
that is send to the brower on the client side.
Now to my question.
Why is no VIEWSTATE send to the browser when we have the runat="server"
attribute removed ?
You can see it for yourself in my listings below.
Default.aspx when we have runat="server" on the form tag
*******************************************
(1)
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs"
Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
Testing
</div>
</form>
</body>
</html>
(2)
This html code correspond to the above Default.aspx page.
This html code is sent to the browser on the client side
*******************************************
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>
Untitled Page
</title></head>
<body>
<form name="form1" method="post" action="Default.aspx" id="form1">
<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE"
value="/wEPDwUJNzgzNDMwNTMzZGSK/6SoraIMYhAyosKtnFrMdvLWXQ==" />
</div>
<div>
Testing
</div>
</form>
</body>
</html>
(3)
Default.aspx when we don't have runat="server" on the form tag
************************************************
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs"
Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1">
<div>
Testing
</div>
</form>
</body>
</html>
(4)
This html code correspond to the above Default.aspx page.
This html code is sent to the browser on the client side
********************************************
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>
Untitled Page
</title></head>
<body>
<form id="form1">
<div>
Testing
</div>
</form>
</body>
</html>
//Tony