Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
Page Class
Page Properties
 MaxPageStateFieldLength Property

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.NET Framework Class Library
Page..::.MaxPageStateFieldLength Property

Gets or sets the maximum length for the page's state field.

Namespace:  System.Web.UI
Assembly:  System.Web (in System.Web.dll)
Visual Basic (Declaration)
<BrowsableAttribute(False)> _
Public Property MaxPageStateFieldLength As Integer
Visual Basic (Usage)
Dim instance As Page
Dim value As Integer

value = instance.MaxPageStateFieldLength

instance.MaxPageStateFieldLength = value
C#
[BrowsableAttribute(false)]
public int MaxPageStateFieldLength { get; set; }
Visual C++
[BrowsableAttribute(false)]
public:
property int MaxPageStateFieldLength {
    int get ();
    void set (int value);
}
JScript
public function get MaxPageStateFieldLength () : int
public function set MaxPageStateFieldLength (value : int)
ASP.NET
<asp:Page MaxPageStateFieldLength="Int32" />

Property Value

Type: System..::.Int32
The maximum length, in bytes, for the page's state field. The default is -1.
ExceptionCondition
ArgumentException

The MaxPageStateFieldLength property is not equal to -1 or a positive number.

InvalidOperationException

The MaxPageStateFieldLength property was set after the page was initialized.

When the MaxPageStateFieldLength property is set to a positive number, the view state sent to the client browser is broken into multiple hidden fields, and each field's value is less than the size specified in the MaxPageStateFieldLength property.

Setting the MaxPageStateFieldLength property to a negative number (the default) indicates that the view-state field should not be separated into chunks. Setting the MaxPageStateFieldLength to a small number may result in poor performance.

Set the value of the MaxPageStateFieldLength property in the pages element of the Web.config file.

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker