LoadViewState not firing / fired in ASP.NET 2.0

Discussion in 'ASP .Net' started by J., Jan 19, 2005.

  1. J.

    J. Guest

    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>
    J., Jan 19, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. William F. Robertson, Jr.

    LoadViewState not firing

    William F. Robertson, Jr., Apr 16, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    4,413
    William F. Robertson, Jr.
    Apr 16, 2004
  2. =?Utf-8?B?RGV2aW4gRmVuc3RlcmhlaW0=?=

    LoadViewState not firing when Control added with AddAt

    =?Utf-8?B?RGV2aW4gRmVuc3RlcmhlaW0=?=, Jul 18, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    3,499
    Jyoti Ballabh
    Nov 26, 2009
  3. Anand Saha
    Replies:
    0
    Views:
    4,811
    Anand Saha
    Jul 24, 2006
  4. Umbaga

    LoadViewState override not firing in UserControl

    Umbaga, Dec 9, 2003, in forum: ASP .Net Building Controls
    Replies:
    2
    Views:
    268
    Umbaga
    Dec 10, 2003
  5. Bill Biddy

    LoadViewState not firing on PostBack

    Bill Biddy, Jan 20, 2004, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    221
    Bill Biddy
    Jan 20, 2004
Loading...

Share This Page