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
![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
- TextBoxRenderer.cs
- ContentWrapperAttribute.cs
- PieceNameHelper.cs
- TemplateControlCodeDomTreeGenerator.cs
- StringCollection.cs
- ClientBuildManagerCallback.cs
- ContextInformation.cs
- Matrix.cs
- figurelengthconverter.cs
- HtmlShimManager.cs
- SignatureToken.cs
- HasCopySemanticsAttribute.cs
- Mutex.cs
- SessionStateItemCollection.cs
- HuffModule.cs
- ToolStripHighContrastRenderer.cs
- StringInfo.cs
- ContextBase.cs
- InheritablePropertyChangeInfo.cs
- IPEndPoint.cs
- SqlTriggerAttribute.cs
- PageAction.cs
- DragDeltaEventArgs.cs
- CollectionView.cs
- Events.cs
- Vector.cs
- ComponentEvent.cs
- SectionVisual.cs
- XmlPreloadedResolver.cs
- QueryContinueDragEvent.cs
- _SingleItemRequestCache.cs
- WebCategoryAttribute.cs
- METAHEADER.cs
- GeometryHitTestParameters.cs
- AncillaryOps.cs
- SoundPlayerAction.cs
- PropertyTab.cs
- ObjectConverter.cs
- WindowsRichEdit.cs
- ActivityExecutorSurrogate.cs
- MetadataStore.cs
- WindowInteropHelper.cs
- MailAddress.cs
- RegexNode.cs
- EntityEntry.cs
- DetailsViewDeleteEventArgs.cs
- CommonDialog.cs
- UInt64Converter.cs
- BitmapCacheBrush.cs
- DiscoveryEndpoint.cs
- InputBuffer.cs
- WindowsFormsHostAutomationPeer.cs
- ScrollViewer.cs
- Line.cs
- UpDownBaseDesigner.cs
- DiffuseMaterial.cs
- HTMLTagNameToTypeMapper.cs
- PartManifestEntry.cs
- ColorTransformHelper.cs
- DetailsViewAutoFormat.cs
- FixedSOMLineRanges.cs
- ChangeInterceptorAttribute.cs
- IDispatchConstantAttribute.cs
- AddInControllerImpl.cs
- XmlBufferReader.cs
- InvalidEnumArgumentException.cs
- BulletedListEventArgs.cs
- SqlInternalConnectionSmi.cs
- EditorZoneBase.cs
- SubqueryTrackingVisitor.cs
- X509ThumbprintKeyIdentifierClause.cs
- PopupControlService.cs
- ConnectionPointGlyph.cs
- BaseTemplateCodeDomTreeGenerator.cs
- NameValueConfigurationCollection.cs
- PrefixHandle.cs
- StrictModeSecurityHeaderElementInferenceEngine.cs
- ParenthesizePropertyNameAttribute.cs
- EntityContainer.cs
- Registration.cs
- XsltQilFactory.cs
- CreateUserErrorEventArgs.cs
- SegmentTree.cs
- Canvas.cs
- PixelShader.cs
- X509KeyIdentifierClauseType.cs
- DataGridViewRowCancelEventArgs.cs
- sqlmetadatafactory.cs
- TableCell.cs
- HttpPostedFile.cs
- InstanceKeyCompleteException.cs
- WebScriptEndpointElement.cs
- AsymmetricKeyExchangeFormatter.cs
- PictureBox.cs
- TextTreeFixupNode.cs
- Misc.cs
- DependencyPropertyKind.cs
- ISAPIWorkerRequest.cs
- LoginDesigner.cs
- HMAC.cs