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
- CommandManager.cs
- BaseServiceProvider.cs
- TransformedBitmap.cs
- SecureConversationSecurityTokenParameters.cs
- TextDecorationLocationValidation.cs
- WinEventQueueItem.cs
- TextElementEditingBehaviorAttribute.cs
- EmbeddedMailObjectsCollection.cs
- OutOfMemoryException.cs
- NewArrayExpression.cs
- MulticastNotSupportedException.cs
- CanonicalFontFamilyReference.cs
- EmptyStringExpandableObjectConverter.cs
- TypeLibConverter.cs
- TcpConnectionPoolSettingsElement.cs
- Intellisense.cs
- BlobPersonalizationState.cs
- TypeConvertions.cs
- CompiledQuery.cs
- BrowserCapabilitiesFactoryBase.cs
- DesignerSerializationOptionsAttribute.cs
- HtmlContainerControl.cs
- TreeNodeMouseHoverEvent.cs
- LinqDataSourceUpdateEventArgs.cs
- DataIdProcessor.cs
- EntityModelSchemaGenerator.cs
- WindowsSecurityTokenAuthenticator.cs
- DataObjectMethodAttribute.cs
- MostlySingletonList.cs
- COM2IPerPropertyBrowsingHandler.cs
- PartialTrustHelpers.cs
- MarginsConverter.cs
- BindingListCollectionView.cs
- SymLanguageVendor.cs
- TextParaClient.cs
- MexBindingBindingCollectionElement.cs
- BitmapMetadata.cs
- ListViewItem.cs
- EncryptedHeaderXml.cs
- ThreadExceptionEvent.cs
- StyleCollection.cs
- DataGridViewRowEventArgs.cs
- TextControlDesigner.cs
- EmptyStringExpandableObjectConverter.cs
- DiffuseMaterial.cs
- ISAPIWorkerRequest.cs
- DataControlFieldCollection.cs
- xdrvalidator.cs
- ActivityTrace.cs
- tooltip.cs
- TypeUtil.cs
- TypeDelegator.cs
- DoubleLinkListEnumerator.cs
- LocalizeDesigner.cs
- DocumentSchemaValidator.cs
- EmbeddedMailObject.cs
- Speller.cs
- ScriptBehaviorDescriptor.cs
- SubtreeProcessor.cs
- CursorConverter.cs
- SharedDp.cs
- ToolStripRendererSwitcher.cs
- LiteralControl.cs
- ACE.cs
- Privilege.cs
- TagMapCollection.cs
- TextProperties.cs
- MessageBox.cs
- CultureTableRecord.cs
- ServiceDocumentFormatter.cs
- SHA1Managed.cs
- Group.cs
- ApplicationException.cs
- HideDisabledControlAdapter.cs
- InfoCardTrace.cs
- RootBuilder.cs
- categoryentry.cs
- SortQuery.cs
- EntityDataSourceView.cs
- CapacityStreamGeometryContext.cs
- AesManaged.cs
- StyleModeStack.cs
- clipboard.cs
- TraceSection.cs
- listitem.cs
- ProviderCommandInfoUtils.cs
- DependencyPropertyConverter.cs
- EntityKeyElement.cs
- StrongTypingException.cs
- HashRepartitionEnumerator.cs
- DeploymentSectionCache.cs
- UpdatePanelTriggerCollection.cs
- MachineSettingsSection.cs
- ADRoleFactory.cs
- RandomNumberGenerator.cs
- CriticalFinalizerObject.cs
- SchemaEntity.cs
- ModelEditingScope.cs
- Int32Storage.cs
- DescendentsWalkerBase.cs