locked
IIS 6, values not persisting on postback, viewstate is truncated. Need some help! RRS feed

  • Question

  • User89600202 posted

    We have a large number of Win2k3 boxes running IIS 6.  They all run identical codebases.  On only two of the machines, we have a simple scenario where when a form posts back to itself the viewstate is truncated, or it appears to be. All of these boxes are in a farm configuration.

    Things I've checked on these machines when compared to other "working" machines:

    IIS setup appears to be the same - gone through page-by page and compared everything.

    app-level web.config files are identical

    machine-level web.config files are identical

    machine.config files are identical

    codebase is identical.


    I wrote a simple page to test this:

    viewstate_test.aspx:

    <%@ Page Language="C#" AutoEventWireup="true" trace="true" CodeBehind="viewstate_test.aspx.cs" Inherits="WebApplication1.viewstate_test" %>
    
    <!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>
            <asp:TextBox ID="TextBox1" runat="server">testvalue</asp:TextBox>
            <br />
            <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox><br />
            <asp:CheckBox ID="CheckBox1" runat="server" Checked="True" Text="CB1" /><br />
            <asp:CheckBox ID="CheckBox2" runat="server" Text="CB2" /><br />
            <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" /> 
            <br />
            <br />
            <asp:Label ID="Label1" runat="server" Text="ViewState Keys Count= "></asp:Label>
            <asp:Label ID="lblViewState" runat="server"></asp:Label></div>
        </form>
    </body>
    </html>
    


    viewstate_test.aspx.cs:

    using System;
    using System.Data;
    using System.Configuration;
    using System.Collections;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;
    
    namespace WebApplication1
    {
        public partial class viewstate_test : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {
                if (IsPostBack)
                {
                    lblViewState.Text = ViewState.Count.ToString();
                    
                      
                }
            }
        }
    }

    Viewstate on the "good" machine is:

    /wEPDwULLTE5MTE1Njg1NDEPZBYCAgMPZBYCAg0PDxYCHgRUZXh0BQEwZGQYAQUeX19Db250cm9sc1JlcXVpcmVQb3N0QmFja0tleV9fFgIFCUNoZWNrQm94MQUJQ2hlY2tCb3gytQ77ey6g63AYTBfWWEx/xpnW3oY=

    Viewstate on the "bad" machine is:

    /wEPDwULLTE5MTE1Njg1NDFkGAEFHl9fQ29udHJvbHNSZXF1aXJlUG9zdEJhY2tLZXlfXxYCBQlDaGVja0JveDEFCUNoZWNrQm94Mmd3mL/ZR16BJ9WOc9ByTG/p+EfV


    I'm at a bit of a loss on this one.  Anyone have any ideas?

    using System;
    using System.Data;
    using System.Configuration;
    using System.Collections;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;

    namespace WebApplication1
    {
        public partial class viewstate_test : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {
                if (IsPostBack)
                {
                    lblViewState.Text = ViewState.Count.ToString();
                    
                      
                }
            }

            protected void Button1_Click(object sender, EventArgs e)
            {

            }
        }
    }
    using System;
    using System.Data;
    using System.Configuration;
    using System.Collections;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;
    
    namespace WebApplication1
    {
        public partial class viewstate_test : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {
                if (IsPostBack)
                {
                    lblViewState.Text = ViewState.Count.ToString();
                    
                      
                }
            }
        }
    }

    Thursday, August 20, 2009 6:14 PM

All replies

  • User-1659704165 posted

    Hi,

    http://forums.asp.net/p/1115906/1735191.aspx

    http://stackoverflow.com/questions/1200814/proxy-server-truncating-view-state
    OR
    http://support.microsoft.com/kb/832183

    http://support.microsoft.com/kb/831150

    Friday, August 21, 2009 1:13 AM
  • User89600202 posted

    I've read most of these.  There is no proxy server, so I know that is not the issue.  Additionally, there are a number of machines and this only affects two, so I know its not the firewall.

    I don't get any errors that the viewstate has been corrupted or tampered with, so it has to be a server-side issue, or am I missing something?

    Monday, August 24, 2009 9:26 AM