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
- StringBuilder.cs
- DispatchChannelSink.cs
- GenericAuthenticationEventArgs.cs
- UxThemeWrapper.cs
- Material.cs
- HotCommands.cs
- StreamMarshaler.cs
- RegexCaptureCollection.cs
- DecimalConverter.cs
- DockPattern.cs
- InkCollectionBehavior.cs
- PasswordDeriveBytes.cs
- JulianCalendar.cs
- XPathNodeInfoAtom.cs
- TraceListener.cs
- Point3DCollection.cs
- UnsafeNativeMethodsCLR.cs
- ToolStripRendererSwitcher.cs
- ApplicationServiceManager.cs
- SrgsRule.cs
- SubMenuStyleCollectionEditor.cs
- FixedBufferAttribute.cs
- UnsafeNativeMethods.cs
- PublishLicense.cs
- PropertyEmitter.cs
- GridItemProviderWrapper.cs
- Rectangle.cs
- ResizeGrip.cs
- DataGrid.cs
- Exceptions.cs
- SHA1.cs
- RegexCapture.cs
- XmlLanguageConverter.cs
- ThemeableAttribute.cs
- DataGridColumn.cs
- BackgroundWorker.cs
- PointAnimationUsingPath.cs
- EncryptedReference.cs
- SystemUdpStatistics.cs
- NamespaceTable.cs
- SHA1Managed.cs
- ConstructorNeedsTagAttribute.cs
- WebPartConnectionsEventArgs.cs
- AttributeProviderAttribute.cs
- ClickablePoint.cs
- MemberDescriptor.cs
- GridViewColumnHeaderAutomationPeer.cs
- RequestCache.cs
- ColumnMapProcessor.cs
- SafeHandles.cs
- LZCodec.cs
- ExpressionConverter.cs
- AccessibleObject.cs
- ClientWindowsAuthenticationMembershipProvider.cs
- Help.cs
- ACL.cs
- ObjectReaderCompiler.cs
- EqualityArray.cs
- RuleSettingsCollection.cs
- NativeMsmqMessage.cs
- ResolveNameEventArgs.cs
- ProviderBase.cs
- HttpFileCollection.cs
- TransformPattern.cs
- XmlSchemaAppInfo.cs
- RegexCapture.cs
- TextRangeBase.cs
- ClockGroup.cs
- QuotedPrintableStream.cs
- ObjectHelper.cs
- RequiredFieldValidator.cs
- TraceEventCache.cs
- DataServiceQueryProvider.cs
- XmlSchemaSearchPattern.cs
- EntryPointNotFoundException.cs
- TableLayoutStyle.cs
- LocalBuilder.cs
- LineServicesCallbacks.cs
- FormsAuthentication.cs
- NTAccount.cs
- RepeatInfo.cs
- TextBoxDesigner.cs
- TypeKeyValue.cs
- ByeOperation11AsyncResult.cs
- ProfileModule.cs
- QilDataSource.cs
- DesignerSerializationOptionsAttribute.cs
- Util.cs
- BrowserCapabilitiesCompiler.cs
- SqlRecordBuffer.cs
- ToolStripDropDownClosedEventArgs.cs
- DescendantOverDescendantQuery.cs
- StatusBarPanel.cs
- ParenthesizePropertyNameAttribute.cs
- IMembershipProvider.cs
- SqlCacheDependencyDatabase.cs
- FileDetails.cs
- Substitution.cs
- WebPartConnectionsEventArgs.cs
- WhitespaceRuleLookup.cs