LoadViewState not firing / fired in ASP.NET 2.0

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>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top