Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / DEVDIV / depot / DevDiv / releases / whidbey / QFE / ndp / fx / src / xsp / System / Web / UI / WebControls / SessionParameter.cs / 2 / SessionParameter.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.WebControls { using System; using System.ComponentModel; using System.Data; using System.Security.Permissions; ////// Represents a Parameter that gets its value from the application's session state. /// [ DefaultProperty("SessionField"), ] [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] [AspNetHostingPermission(SecurityAction.InheritanceDemand, Level=AspNetHostingPermissionLevel.Minimal)] public class SessionParameter : Parameter { ////// Creates an instance of the SessionParameter class. /// public SessionParameter() { } ////// Creates an instance of the SessionParameter class with the specified parameter name, and session field. /// public SessionParameter(string name, string sessionField) : base(name) { SessionField = sessionField; } ////// Creates an instance of the SessionParameter class with the specified parameter name, database type, and /// session field. /// public SessionParameter(string name, DbType dbType, string sessionField) : base(name, dbType) { SessionField = sessionField; } ////// Creates an instance of the SessionParameter class with the specified parameter name, type, and session field. /// public SessionParameter(string name, TypeCode type, string sessionField) : base(name, type) { SessionField = sessionField; } ////// Used to clone a parameter. /// protected SessionParameter(SessionParameter original) : base(original) { SessionField = original.SessionField; } ////// The name of the session variable to get the value from. /// [ DefaultValue(""), WebCategory("Parameter"), WebSysDescription(SR.SessionParameter_SessionField), ] public string SessionField { get { object o = ViewState["SessionField"]; if (o == null) return String.Empty; return (string)o; } set { if (SessionField != value) { ViewState["SessionField"] = value; OnParameterChanged(); } } } ////// Creates a new SessionParameter that is a copy of this SessionParameter. /// protected override Parameter Clone() { return new SessionParameter(this); } ////// Returns the updated value of the parameter. /// protected override object Evaluate(HttpContext context, Control control) { if (context == null || context.Session == null) { return null; } return context.Session[SessionField]; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.WebControls { using System; using System.ComponentModel; using System.Data; using System.Security.Permissions; ////// Represents a Parameter that gets its value from the application's session state. /// [ DefaultProperty("SessionField"), ] [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] [AspNetHostingPermission(SecurityAction.InheritanceDemand, Level=AspNetHostingPermissionLevel.Minimal)] public class SessionParameter : Parameter { ////// Creates an instance of the SessionParameter class. /// public SessionParameter() { } ////// Creates an instance of the SessionParameter class with the specified parameter name, and session field. /// public SessionParameter(string name, string sessionField) : base(name) { SessionField = sessionField; } ////// Creates an instance of the SessionParameter class with the specified parameter name, database type, and /// session field. /// public SessionParameter(string name, DbType dbType, string sessionField) : base(name, dbType) { SessionField = sessionField; } ////// Creates an instance of the SessionParameter class with the specified parameter name, type, and session field. /// public SessionParameter(string name, TypeCode type, string sessionField) : base(name, type) { SessionField = sessionField; } ////// Used to clone a parameter. /// protected SessionParameter(SessionParameter original) : base(original) { SessionField = original.SessionField; } ////// The name of the session variable to get the value from. /// [ DefaultValue(""), WebCategory("Parameter"), WebSysDescription(SR.SessionParameter_SessionField), ] public string SessionField { get { object o = ViewState["SessionField"]; if (o == null) return String.Empty; return (string)o; } set { if (SessionField != value) { ViewState["SessionField"] = value; OnParameterChanged(); } } } ////// Creates a new SessionParameter that is a copy of this SessionParameter. /// protected override Parameter Clone() { return new SessionParameter(this); } ////// Returns the updated value of the parameter. /// protected override object Evaluate(HttpContext context, Control control) { if (context == null || context.Session == null) { return null; } return context.Session[SessionField]; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Button.cs
- TextParaLineResult.cs
- EpmContentSerializer.cs
- SharedStream.cs
- PenContext.cs
- MethodCallTranslator.cs
- DataControlCommands.cs
- StringArrayConverter.cs
- SqlOuterApplyReducer.cs
- SourceFileBuildProvider.cs
- FirewallWrapper.cs
- UserControlBuildProvider.cs
- XmlILModule.cs
- TextEditorTables.cs
- PartitionerQueryOperator.cs
- BaseUriHelper.cs
- Blend.cs
- ClientBuildManagerCallback.cs
- DataGridViewColumnCollection.cs
- Context.cs
- SelfIssuedAuthAsymmetricKey.cs
- SecurityTokenException.cs
- FixUp.cs
- _TLSstream.cs
- BackgroundWorker.cs
- StrokeCollectionConverter.cs
- TdsParserStateObject.cs
- SmtpSection.cs
- FillRuleValidation.cs
- GuidConverter.cs
- Command.cs
- ByteStorage.cs
- DataGridViewRowEventArgs.cs
- newinstructionaction.cs
- ServiceObjectContainer.cs
- EnvelopedPkcs7.cs
- TextElementEnumerator.cs
- RegexBoyerMoore.cs
- RectangleGeometry.cs
- Point3DIndependentAnimationStorage.cs
- SByte.cs
- ParseChildrenAsPropertiesAttribute.cs
- SafeRightsManagementSessionHandle.cs
- RtfToken.cs
- TextEffectCollection.cs
- DummyDataSource.cs
- DataGridViewColumnDesigner.cs
- XmlUTF8TextReader.cs
- StringAnimationUsingKeyFrames.cs
- ComplexType.cs
- DesignTimeParseData.cs
- ConnectionOrientedTransportChannelListener.cs
- Pair.cs
- DataReceivedEventArgs.cs
- PropertyDescriptor.cs
- WebException.cs
- GridToolTip.cs
- StrongNameUtility.cs
- DataGridViewAutoSizeColumnsModeEventArgs.cs
- BinaryFormatter.cs
- Speller.cs
- ThrowHelper.cs
- PermissionToken.cs
- EventRecordWrittenEventArgs.cs
- HopperCache.cs
- HttpApplicationStateBase.cs
- SecurityElement.cs
- PersonalizableTypeEntry.cs
- ThreadExceptionDialog.cs
- ObjectConverter.cs
- ProcessModelSection.cs
- TimeSpanValidator.cs
- LinkedList.cs
- RtfControls.cs
- FieldNameLookup.cs
- UnsafeNativeMethods.cs
- SystemInfo.cs
- X509PeerCertificateAuthenticationElement.cs
- SingleTagSectionHandler.cs
- DataGridItemCollection.cs
- ShaderRenderModeValidation.cs
- XPathEmptyIterator.cs
- PageWrapper.cs
- TextFormatterImp.cs
- DomNameTable.cs
- MemberCollection.cs
- SQLGuid.cs
- XDRSchema.cs
- SQLSingleStorage.cs
- ClientRuntimeConfig.cs
- formatter.cs
- PersistenceParticipant.cs
- Html32TextWriter.cs
- BufferBuilder.cs
- ObjectDataSource.cs
- FlowDocumentFormatter.cs
- Console.cs
- InputScope.cs
- loginstatus.cs
- URL.cs