Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / UI / HiddenFieldPageStatePersister.cs / 1305376 / HiddenFieldPageStatePersister.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI { using System; using System.Collections; using System.Collections.Specialized; using System.IO; using System.Text; using System.Security.Permissions; 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(StateFormatter, viewStateString); 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); } } ////// To be supplied. /// public override void Save() { if (ViewState != null || ControlState != null) { Page.ClientState = Util.SerializeWithAssert(StateFormatter, new Pair(ViewState, ControlState)); } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI { using System; using System.Collections; using System.Collections.Specialized; using System.IO; using System.Text; using System.Security.Permissions; 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(StateFormatter, viewStateString); 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); } } ////// To be supplied. /// public override void Save() { if (ViewState != null || ControlState != null) { Page.ClientState = Util.SerializeWithAssert(StateFormatter, new Pair(ViewState, ControlState)); } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- StringWriter.cs
- DebugView.cs
- QueryOptionExpression.cs
- WindowsGraphicsWrapper.cs
- StrokeCollection.cs
- FixedSOMLineCollection.cs
- WindowVisualStateTracker.cs
- RuleSettings.cs
- MonthChangedEventArgs.cs
- ProjectedSlot.cs
- BamlTreeNode.cs
- SemaphoreSecurity.cs
- RequestQueue.cs
- SqlLiftWhereClauses.cs
- Type.cs
- LogRestartAreaEnumerator.cs
- XmlRawWriter.cs
- ExternalFile.cs
- RelationshipEndMember.cs
- AuthenticationModuleElement.cs
- ToggleButton.cs
- SoapAttributeOverrides.cs
- XmlDsigSep2000.cs
- TextContainerChangeEventArgs.cs
- DocumentViewerHelper.cs
- PropertyStore.cs
- CatalogPart.cs
- PermissionSet.cs
- ApplicationFileCodeDomTreeGenerator.cs
- ColorMatrix.cs
- InfoCardRSACryptoProvider.cs
- QilInvokeLateBound.cs
- dataobject.cs
- DataGridViewAutoSizeColumnsModeEventArgs.cs
- SyntaxCheck.cs
- CachedPathData.cs
- XamlFrame.cs
- SqlBuilder.cs
- ToolBarTray.cs
- NeutralResourcesLanguageAttribute.cs
- Membership.cs
- ExtensibleClassFactory.cs
- X509InitiatorCertificateServiceElement.cs
- BookmarkInfo.cs
- HttpStreamMessage.cs
- SerializeAbsoluteContext.cs
- XPathParser.cs
- InputChannelBinder.cs
- DBSqlParserTableCollection.cs
- ReachDocumentReferenceCollectionSerializerAsync.cs
- GridViewUpdatedEventArgs.cs
- SmtpNegotiateAuthenticationModule.cs
- IdnElement.cs
- PcmConverter.cs
- PackageProperties.cs
- WorkflowOperationInvoker.cs
- ScrollableControl.cs
- OutputScopeManager.cs
- Utils.cs
- InternalPermissions.cs
- QueueException.cs
- HttpAsyncResult.cs
- PathStreamGeometryContext.cs
- JulianCalendar.cs
- TypefaceCollection.cs
- ManipulationBoundaryFeedbackEventArgs.cs
- SpeechAudioFormatInfo.cs
- WSHttpTransportSecurityElement.cs
- IntPtr.cs
- DataGridViewSelectedRowCollection.cs
- SrgsSubset.cs
- NGCSerializer.cs
- DoubleConverter.cs
- DbUpdateCommandTree.cs
- SplashScreen.cs
- ResourceExpressionBuilder.cs
- SqlBuffer.cs
- Repeater.cs
- RtfToXamlLexer.cs
- EventDescriptorCollection.cs
- HttpClientCertificate.cs
- TabControl.cs
- brushes.cs
- CodeSubDirectory.cs
- ForceCopyBuildProvider.cs
- ControlParameter.cs
- ModifierKeysValueSerializer.cs
- WebPartZone.cs
- TraceSwitch.cs
- BulletChrome.cs
- XmlDocumentSchema.cs
- KeyedHashAlgorithm.cs
- CodeExporter.cs
- DoubleSumAggregationOperator.cs
- DBCommandBuilder.cs
- TTSVoice.cs
- ConfigurationStrings.cs
- _SSPIWrapper.cs
- IntSecurity.cs
- AutomationPropertyInfo.cs