Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / xsp / System / Web / UI / WebControls / SessionParameter.cs / 1 / 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. // //----------------------------------------------------------------------------- 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- login.cs
- DataGridViewRowPrePaintEventArgs.cs
- FixedSOMPageConstructor.cs
- Menu.cs
- ValidatingPropertiesEventArgs.cs
- BulletedList.cs
- TriState.cs
- ConfigurationCollectionAttribute.cs
- WSHttpSecurityElement.cs
- SendMailErrorEventArgs.cs
- ApplicationActivator.cs
- StyleSheet.cs
- ResourceAttributes.cs
- BrowserDefinition.cs
- MethodExpression.cs
- ComboBoxRenderer.cs
- ObjectConverter.cs
- RtfControls.cs
- ReliableRequestSessionChannel.cs
- DocumentSchemaValidator.cs
- ResourcePart.cs
- ValidatorCollection.cs
- Evaluator.cs
- PenThreadPool.cs
- ValueQuery.cs
- SafeRightsManagementHandle.cs
- TextServicesDisplayAttribute.cs
- RootBrowserWindowAutomationPeer.cs
- Image.cs
- rsa.cs
- ServiceDocumentFormatter.cs
- BoundingRectTracker.cs
- CellLabel.cs
- PipeStream.cs
- Matrix.cs
- UncommonField.cs
- OracleString.cs
- PointAnimationUsingKeyFrames.cs
- CompilationUtil.cs
- FullTextState.cs
- SystemWebExtensionsSectionGroup.cs
- AuthenticatedStream.cs
- NamedPipeConnectionPoolSettings.cs
- CodeArrayIndexerExpression.cs
- SafePointer.cs
- TextReader.cs
- KoreanLunisolarCalendar.cs
- TraceHandlerErrorFormatter.cs
- HttpDebugHandler.cs
- DataGridViewColumnEventArgs.cs
- AuthenticationService.cs
- EntityParameter.cs
- SqlProviderServices.cs
- DecoratedNameAttribute.cs
- EmbeddedMailObject.cs
- CommandHelper.cs
- StringStorage.cs
- X509InitiatorCertificateClientElement.cs
- IDQuery.cs
- DocumentSequence.cs
- XMLSchema.cs
- KeyValueConfigurationCollection.cs
- CfgParser.cs
- DbMetaDataCollectionNames.cs
- GridViewRow.cs
- XpsStructure.cs
- ComPlusThreadInitializer.cs
- FormView.cs
- Line.cs
- ConfigXmlElement.cs
- CommandDevice.cs
- Int32.cs
- WorkItem.cs
- ChannelServices.cs
- SelectionPatternIdentifiers.cs
- TypedReference.cs
- Models.cs
- XPathDescendantIterator.cs
- KeyTime.cs
- KeyFrames.cs
- StateManager.cs
- FormsIdentity.cs
- ProviderUtil.cs
- CompositeDataBoundControl.cs
- QuaternionAnimation.cs
- Selector.cs
- WindowInteractionStateTracker.cs
- BooleanConverter.cs
- DefaultHttpHandler.cs
- ControlUtil.cs
- AuthorizationSection.cs
- cryptoapiTransform.cs
- StorageAssociationTypeMapping.cs
- NavigatingCancelEventArgs.cs
- InArgument.cs
- Attributes.cs
- ImageDrawing.cs
- GregorianCalendar.cs
- LocalizableResourceBuilder.cs
- OperandQuery.cs