By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,335 Members | 2,258 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,335 IT Pros & Developers. It's quick & easy.

LoadViewState not firing / fired in ASP.NET 2.0

P: n/a
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/wh.../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>
Nov 19 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.