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
- Selection.cs
- PrimitiveDataContract.cs
- ApplicationContext.cs
- RedistVersionInfo.cs
- TraceFilter.cs
- ThreadAbortException.cs
- AsyncPostBackTrigger.cs
- StickyNote.cs
- DataGridColumnFloatingHeader.cs
- FrameworkTemplate.cs
- WebPartEditorCancelVerb.cs
- GPPOINTF.cs
- CoTaskMemUnicodeSafeHandle.cs
- RegistrationServices.cs
- WindowsContainer.cs
- TextTrailingCharacterEllipsis.cs
- XPathChildIterator.cs
- XmlEventCache.cs
- Style.cs
- ViewUtilities.cs
- DataGridItemAutomationPeer.cs
- ListSortDescriptionCollection.cs
- BaseCodePageEncoding.cs
- PathSegment.cs
- FilterableAttribute.cs
- GeneralTransform2DTo3D.cs
- Command.cs
- FontResourceCache.cs
- AsyncPostBackTrigger.cs
- CompoundFileStreamReference.cs
- GreenMethods.cs
- Logging.cs
- LogSwitch.cs
- JpegBitmapDecoder.cs
- ActivityDesignerHighlighter.cs
- DefaultTypeArgumentAttribute.cs
- CacheDependency.cs
- TableItemPattern.cs
- InternalRelationshipCollection.cs
- SchemaDeclBase.cs
- ScrollProviderWrapper.cs
- TransferRequestHandler.cs
- Expander.cs
- RC2.cs
- FieldBuilder.cs
- InternalConfigSettingsFactory.cs
- ShaperBuffers.cs
- PeerResolverElement.cs
- DashStyles.cs
- TcpAppDomainProtocolHandler.cs
- ExpressionNormalizer.cs
- SelectQueryOperator.cs
- CompositeCollectionView.cs
- RenderData.cs
- FunctionMappingTranslator.cs
- MaxMessageSizeStream.cs
- ShaperBuffers.cs
- SynchronousSendBindingElement.cs
- oledbconnectionstring.cs
- SqlProcedureAttribute.cs
- RepeatBehaviorConverter.cs
- DecoratedNameAttribute.cs
- HeaderedContentControl.cs
- IconBitmapDecoder.cs
- DataGridViewLinkCell.cs
- RuleDefinitions.cs
- ReturnEventArgs.cs
- PreviewKeyDownEventArgs.cs
- SelectorAutomationPeer.cs
- DependencyPropertyKind.cs
- SequentialOutput.cs
- Vector3DAnimationUsingKeyFrames.cs
- SHA512Cng.cs
- CriticalExceptions.cs
- NamedPermissionSet.cs
- InstanceHandle.cs
- CorrelationManager.cs
- AssemblyBuilderData.cs
- TraceLevelStore.cs
- SqlServer2KCompatibilityCheck.cs
- XmlEncodedRawTextWriter.cs
- UnaryExpression.cs
- GifBitmapEncoder.cs
- CopyCodeAction.cs
- Matrix3D.cs
- PageEventArgs.cs
- AstNode.cs
- XmlStreamedByteStreamReader.cs
- MultiView.cs
- FixedFlowMap.cs
- DetailsView.cs
- StateDesigner.TransitionInfo.cs
- RtfControlWordInfo.cs
- DetailsViewPageEventArgs.cs
- CRYPTPROTECT_PROMPTSTRUCT.cs
- EntityDataSourceReferenceGroup.cs
- TrustManagerPromptUI.cs
- ProgressiveCrcCalculatingStream.cs
- AssociationEndMember.cs
- ToolboxDataAttribute.cs