J
J.
Hello,
I'm trying to override the LoadViewState-method of a simple page using
the .NET Framework 2.0. However, the LoadViewState-method in the code
below never gets executed. The SaveViewState-method gets executed on
every page request as described in
http://msdn.microsoft.com/asp.net/whidbey/default.aspx?pull=/library/en-us/dnvs05/html/internals.asp
Can anyone pinpoint the problem? (Or am I just a dumbass?)
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<script runat="server">
protected override void LoadViewState(object savedState)
{
Trace.Write("Testing LoadViewState...");
base.LoadViewState(savedState);
}
protected override object SaveViewState()
{
Trace.Write("Testing SaveViewState...");
return base.SaveViewState();
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Button ID="Button1" Runat="server" Text="Button" />
</div>
</form>
</body>
</html>
I'm trying to override the LoadViewState-method of a simple page using
the .NET Framework 2.0. However, the LoadViewState-method in the code
below never gets executed. The SaveViewState-method gets executed on
every page request as described in
http://msdn.microsoft.com/asp.net/whidbey/default.aspx?pull=/library/en-us/dnvs05/html/internals.asp
Can anyone pinpoint the problem? (Or am I just a dumbass?)
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<script runat="server">
protected override void LoadViewState(object savedState)
{
Trace.Write("Testing LoadViewState...");
base.LoadViewState(savedState);
}
protected override object SaveViewState()
{
Trace.Write("Testing SaveViewState...");
return base.SaveViewState();
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Button ID="Button1" Runat="server" Text="Button" />
</div>
</form>
</body>
</html>