Page.LoadPageStateFromPersistenceMedium Page.LoadPageStateFromPersistenceMedium Page.LoadPageStateFromPersistenceMedium Page.LoadPageStateFromPersistenceMedium Method

定義

載入任何儲存的檢視狀態資訊到 Page 物件。Loads any saved view-state information to the Page object.

protected public:
 virtual System::Object ^ LoadPageStateFromPersistenceMedium();
protected internal virtual object LoadPageStateFromPersistenceMedium ();
abstract member LoadPageStateFromPersistenceMedium : unit -> obj
override this.LoadPageStateFromPersistenceMedium : unit -> obj
Protected Friend Overridable Function LoadPageStateFromPersistenceMedium () As Object

傳回

儲存的檢視狀態。The saved view state.

備註

LoadPageStateFromPersistenceMedium方法會使用Load方法System.Web.UI.PageStatePersister所參考物件PageStatePersister屬性,以載入任何儲存的檢視狀態資訊Page物件。The LoadPageStateFromPersistenceMedium method uses the Load method of the System.Web.UI.PageStatePersister object referenced by the PageStatePersister property to load any saved view-state information for the Page object.

ASP.NET 包含的兩個下階PageStatePersister類別,HiddenFieldPageStatePersister包含在 ASP.NET 頁面中,隱藏欄位中儲存狀態資訊的類別和SessionPageStatePersister儲存狀態中的類別Session與相關聯的物件要求。ASP.NET includes two descendents of the PageStatePersister class, the HiddenFieldPageStatePersister class that saves state information in a hidden field included in the ASP.NET page, and the SessionPageStatePersister class that saves state in the Session object associated with the request.

若要將狀態儲存在您選擇的位置,您應該建立新的子系PageStatePersister儲存及載入至持續性媒體狀態,您選擇的類別。To save state in the location of your choice, you should create a new descendent of the PageStatePersister class that saves and loads state to the persistence medium of your choice. 如需建立新的範例PageStatePersister資訊,請參閱PageStatePersister類別。For an example of creating a new PageStatePersister object, see the PageStatePersister class.

如果您使用.NET Framework 版本為 1.0 或 1.1,覆寫這個方法,如果您想要載入Page從隱藏的欄位以外的任何狀態。If you are using the .NET Framework version 1.0 or 1.1, override this method if you want to load the Page state from anything other than a hidden field. 如果您選擇這樣做,您也必須覆寫SavePageStateToPersistenceMedium方法。If you choose to do so, you must also override the SavePageStateToPersistenceMedium method.

適用於

另請參閱