mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-19 01:31:17 -10:00
Adding reference source for System.Data System.Data.DataSetExtensions System.Data.Entity System.Data.Entity.Design System.Data.Linq System.Data.SqlXml System.ServiceModel System.ServiceModel.Activation System.ServiceModel.Activities System.ServiceModel.Channels System.ServiceModel.Discovery System.ServiceModel.Internals System.ServiceModel.Routing System.ServiceModel.WasHosting System.ServiceModel.Web System.Web System.Web.ApplicationServices System.Web.DynamicData System.Web.Entity System.Web.Entity.Design System.Web.Extensions System.Web.Mobile System.Web.Routing System.Web.Services System.Xml System.Xml.Linq
58 lines
2.2 KiB
C#
58 lines
2.2 KiB
C#
//------------------------------------------------------------------------------
|
|
// <copyright file="HiddenFieldPersister.cs" company="Microsoft">
|
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
// </copyright>
|
|
//------------------------------------------------------------------------------
|
|
|
|
namespace System.Web.UI {
|
|
using System;
|
|
using System.Collections;
|
|
using System.Collections.Specialized;
|
|
using System.IO;
|
|
using System.Text;
|
|
using System.Security.Permissions;
|
|
using System.Web.Security.Cryptography;
|
|
|
|
public class HiddenFieldPageStatePersister : PageStatePersister {
|
|
public HiddenFieldPageStatePersister(Page page) : base (page) {
|
|
}
|
|
|
|
public override void Load() {
|
|
NameValueCollection requestValueCollection = Page.RequestValueCollection;
|
|
if (requestValueCollection == null) {
|
|
return;
|
|
}
|
|
|
|
string viewStateString = null;
|
|
try {
|
|
viewStateString = Page.RequestViewStateString;
|
|
|
|
// VSWhidbey 160556
|
|
if (!String.IsNullOrEmpty(viewStateString) || !String.IsNullOrEmpty(Page.ViewStateUserKey)) {
|
|
Pair combinedState = (Pair)Util.DeserializeWithAssert(StateFormatter2, viewStateString, Purpose.WebForms_HiddenFieldPageStatePersister_ClientState);
|
|
ViewState = combinedState.First;
|
|
ControlState = combinedState.Second;
|
|
}
|
|
}
|
|
catch (Exception e) {
|
|
// throw if this is a wrapped ViewStateException -- mac validation failed
|
|
if (e.InnerException is ViewStateException) {
|
|
throw;
|
|
}
|
|
|
|
ViewStateException.ThrowViewStateError(e, viewStateString);
|
|
}
|
|
}
|
|
|
|
|
|
/// <devdoc>
|
|
/// To be supplied.
|
|
/// </devdoc>
|
|
public override void Save() {
|
|
if (ViewState != null || ControlState != null) {
|
|
Page.ClientState = Util.SerializeWithAssert(StateFormatter2, new Pair(ViewState, ControlState), Purpose.WebForms_HiddenFieldPageStatePersister_ClientState);
|
|
}
|
|
}
|
|
}
|
|
}
|