Page.MaxPageStateFieldLength Page.MaxPageStateFieldLength Page.MaxPageStateFieldLength Page.MaxPageStateFieldLength Property

定義

取得或設定頁面狀態欄位的最大長度。Gets or sets the maximum length for the page's state field.

public:
 property int MaxPageStateFieldLength { int get(); void set(int value); };
[System.ComponentModel.Browsable(false)]
public int MaxPageStateFieldLength { get; set; }
member this.MaxPageStateFieldLength : int with get, set
Public Property MaxPageStateFieldLength As Integer

屬性值

頁面狀態欄位的最大長度 (以位元組為單位)。The maximum length, in bytes, for the page's state field. 預設值為 -1。The default is -1.

例外狀況

MaxPageStateFieldLength 屬性不等於 -1 或正數。The MaxPageStateFieldLength property is not equal to -1 or a positive number.

MaxPageStateFieldLength 屬性已在頁面初始化之後設定。The MaxPageStateFieldLength property was set after the page was initialized.

備註

MaxPageStateFieldLength屬性設定為正數,傳送到用戶端瀏覽器的檢視狀態分為多個隱藏的欄位,每個欄位的值小於指定大小MaxPageStateFieldLength屬性。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.

設定MaxPageStateFieldLength負數 (預設值) 的屬性表示檢視狀態欄位不應該分隔成多個區塊。Setting the MaxPageStateFieldLength property to a negative number (the default) indicates that the view-state field should not be separated into chunks. 設定MaxPageStateFieldLength為小的數目可能會導致效能不佳。Setting the MaxPageStateFieldLength to a small number may result in poor performance.

設定的值MaxPageStateFieldLength中的屬性pages 項目Web.config 檔案。Set the value of the MaxPageStateFieldLength property in the pages element of the Web.config file.

適用於