Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / UI / WebControls / SessionParameter.cs / 1305376 / SessionParameter.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.WebControls { using System; using System.ComponentModel; using System.Data; ////// Represents a Parameter that gets its value from the application's session state. /// [ DefaultProperty("SessionField"), ] 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 internal 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; ////// Represents a Parameter that gets its value from the application's session state. /// [ DefaultProperty("SessionField"), ] 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 internal 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
- MissingFieldException.cs
- Crc32.cs
- HttpCookieCollection.cs
- UnsafeNativeMethods.cs
- DataGridLinkButton.cs
- DbCommandTree.cs
- MachineSettingsSection.cs
- UnsafeMethods.cs
- OleDbPermission.cs
- ListItemCollection.cs
- QueryPageSettingsEventArgs.cs
- CalendarTable.cs
- PropVariant.cs
- DrawingBrush.cs
- PropertyStore.cs
- RC2CryptoServiceProvider.cs
- SqlConnectionFactory.cs
- ItemsPresenter.cs
- TdsParserStaticMethods.cs
- LinqDataSourceInsertEventArgs.cs
- XmlValidatingReader.cs
- EntityDataSourceContextCreatedEventArgs.cs
- DbConnectionOptions.cs
- AppDomainResourcePerfCounters.cs
- EntityViewGenerator.cs
- SafeLibraryHandle.cs
- ClientUrlResolverWrapper.cs
- CurrentChangingEventArgs.cs
- AppDomainInstanceProvider.cs
- SchemaMerger.cs
- ToolStripTemplateNode.cs
- XmlSignificantWhitespace.cs
- ObjectDataSourceDisposingEventArgs.cs
- DecoratedNameAttribute.cs
- CompilationRelaxations.cs
- SoapTypeAttribute.cs
- CopyAction.cs
- FunctionUpdateCommand.cs
- MapPathBasedVirtualPathProvider.cs
- WaitForChangedResult.cs
- Stream.cs
- Stopwatch.cs
- BufferedWebEventProvider.cs
- GridViewPageEventArgs.cs
- ContentOperations.cs
- StringDictionaryWithComparer.cs
- BufferedGraphicsManager.cs
- TextRangeBase.cs
- X509Certificate.cs
- CopyNodeSetAction.cs
- Types.cs
- ScrollBar.cs
- MailMessageEventArgs.cs
- HostingEnvironmentException.cs
- RijndaelCryptoServiceProvider.cs
- SplayTreeNode.cs
- KoreanCalendar.cs
- XPathNodePointer.cs
- TableLayoutCellPaintEventArgs.cs
- TextDocumentView.cs
- BooleanToVisibilityConverter.cs
- DataGridItemEventArgs.cs
- KeyManager.cs
- PauseStoryboard.cs
- DesignOnlyAttribute.cs
- DataGridViewDataErrorEventArgs.cs
- KoreanLunisolarCalendar.cs
- AxHostDesigner.cs
- Empty.cs
- MachineSettingsSection.cs
- TdsParserHelperClasses.cs
- NameValuePermission.cs
- XmlCharacterData.cs
- SmtpLoginAuthenticationModule.cs
- AtomMaterializerLog.cs
- ReflectionTypeLoadException.cs
- DbTypeMap.cs
- RepeatBehavior.cs
- DataGridViewElement.cs
- ProviderException.cs
- XmlRawWriter.cs
- MarkupCompilePass1.cs
- ButtonBase.cs
- RemotingConfigParser.cs
- EditorZone.cs
- StringExpressionSet.cs
- UInt32.cs
- HtmlTableCellCollection.cs
- PlaceHolder.cs
- TextComposition.cs
- ExpanderAutomationPeer.cs
- ToolStripLabel.cs
- BuildManagerHost.cs
- versioninfo.cs
- PreviewKeyDownEventArgs.cs
- DataGridHelper.cs
- UidManager.cs
- KoreanLunisolarCalendar.cs
- HttpException.cs
- EventListener.cs