Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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. // //----------------------------------------------------------------------------- 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
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ClientBuildManager.cs
- SqlCommandAsyncResult.cs
- RawStylusInput.cs
- PictureBoxDesigner.cs
- ClientSession.cs
- ResolveNameEventArgs.cs
- CorrelationQueryBehavior.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- DocumentEventArgs.cs
- RegexGroup.cs
- OdbcParameterCollection.cs
- XPathQueryGenerator.cs
- MulticastDelegate.cs
- Accessible.cs
- VerticalAlignConverter.cs
- RadioButtonList.cs
- TypeConverterHelper.cs
- DataServiceRequestOfT.cs
- XamlTreeBuilderBamlRecordWriter.cs
- CryptoKeySecurity.cs
- StrokeNodeEnumerator.cs
- ObjectDataSourceView.cs
- ControlCollection.cs
- FixedSOMContainer.cs
- Substitution.cs
- ControlBuilder.cs
- DetailsViewRowCollection.cs
- UIElement3D.cs
- TypeConverter.cs
- HyperLinkField.cs
- SqlXml.cs
- TextUtf8RawTextWriter.cs
- ToolboxDataAttribute.cs
- SortFieldComparer.cs
- UrlAuthorizationModule.cs
- BooleanToVisibilityConverter.cs
- XmlWriterTraceListener.cs
- InvokeBinder.cs
- ParentControlDesigner.cs
- ComplexObject.cs
- DataMemberConverter.cs
- RemoveStoryboard.cs
- PiiTraceSource.cs
- Form.cs
- MDIClient.cs
- ErrorInfoXmlDocument.cs
- WindowsGraphics.cs
- PingReply.cs
- ListControl.cs
- FileAuthorizationModule.cs
- MatrixCamera.cs
- Type.cs
- metadatamappinghashervisitor.hashsourcebuilder.cs
- EnlistmentTraceIdentifier.cs
- InstrumentationTracker.cs
- DeploymentExceptionMapper.cs
- InputBuffer.cs
- PauseStoryboard.cs
- ComNativeDescriptor.cs
- TextParagraphCache.cs
- RefreshEventArgs.cs
- IgnoreDataMemberAttribute.cs
- NumericExpr.cs
- SystemIPGlobalProperties.cs
- documentation.cs
- ConfigurationLocationCollection.cs
- TimersDescriptionAttribute.cs
- EnvelopedPkcs7.cs
- NameSpaceExtractor.cs
- UserControlFileEditor.cs
- IndexerNameAttribute.cs
- TransformerInfo.cs
- Propagator.JoinPropagator.cs
- StylusPointProperty.cs
- OpCopier.cs
- HScrollBar.cs
- MemberDescriptor.cs
- DependencyPropertyKind.cs
- Nullable.cs
- AnnotationAuthorChangedEventArgs.cs
- BrowserCapabilitiesFactoryBase.cs
- WebPartConnection.cs
- OverlappedAsyncResult.cs
- ImageList.cs
- XamlFigureLengthSerializer.cs
- TransactionChannelListener.cs
- ViewStateChangedEventArgs.cs
- HttpContext.cs
- XmlDigitalSignatureProcessor.cs
- EngineSiteSapi.cs
- Expression.cs
- BasicKeyConstraint.cs
- UpdateException.cs
- SecurityRuntime.cs
- WindowsAltTab.cs
- ProcessHostMapPath.cs
- IPHostEntry.cs
- WindowsUpDown.cs
- FilteredSchemaElementLookUpTable.cs
- ServiceBusyException.cs