Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / xsp / System / Web / UI / WebControls / SessionParameter.cs / 1 / SessionParameter.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.WebControls { using System; using System.ComponentModel; using System.Data; using System.Security.Permissions; ////// Represents a Parameter that gets its value from the application's session state. /// [ DefaultProperty("SessionField"), ] [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] [AspNetHostingPermission(SecurityAction.InheritanceDemand, Level=AspNetHostingPermissionLevel.Minimal)] 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 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; using System.Security.Permissions; ////// Represents a Parameter that gets its value from the application's session state. /// [ DefaultProperty("SessionField"), ] [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] [AspNetHostingPermission(SecurityAction.InheritanceDemand, Level=AspNetHostingPermissionLevel.Minimal)] 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 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
- HostingEnvironmentException.cs
- PointHitTestParameters.cs
- UndoManager.cs
- OutputScopeManager.cs
- MarkupProperty.cs
- PaperSource.cs
- X509CertificateClaimSet.cs
- Size3D.cs
- ListViewInsertEventArgs.cs
- DecimalKeyFrameCollection.cs
- ReturnValue.cs
- AppSettingsExpressionBuilder.cs
- XamlContextStack.cs
- Point3DConverter.cs
- QueuePathEditor.cs
- SelfIssuedAuthRSAPKCS1SignatureFormatter.cs
- _AuthenticationState.cs
- documentation.cs
- DesignerView.Commands.cs
- AudioSignalProblemOccurredEventArgs.cs
- CursorConverter.cs
- ColumnTypeConverter.cs
- WeakReferenceList.cs
- CodeGroup.cs
- SortDescriptionCollection.cs
- OuterGlowBitmapEffect.cs
- ByteAnimationUsingKeyFrames.cs
- nulltextnavigator.cs
- OpacityConverter.cs
- XmlWriterDelegator.cs
- Script.cs
- NonSerializedAttribute.cs
- DbParameterCollection.cs
- Range.cs
- RoleBoolean.cs
- PropertyState.cs
- QilFunction.cs
- RequestBringIntoViewEventArgs.cs
- BaseTemplateCodeDomTreeGenerator.cs
- RecognizedWordUnit.cs
- ServiceThrottlingElement.cs
- ADConnectionHelper.cs
- SettingsPropertyValue.cs
- MultiBindingExpression.cs
- ScopedKnownTypes.cs
- InstanceCreationEditor.cs
- ActivityBindForm.cs
- DynamicUpdateCommand.cs
- MemberRelationshipService.cs
- SizeFConverter.cs
- ExternalFile.cs
- Win32PrintDialog.cs
- CapabilitiesState.cs
- DynamicILGenerator.cs
- FontStretchConverter.cs
- NamespaceCollection.cs
- XmlSchemaInfo.cs
- Vector3DKeyFrameCollection.cs
- GridViewColumn.cs
- Stackframe.cs
- CollectionDataContractAttribute.cs
- Ray3DHitTestResult.cs
- VisualTreeHelper.cs
- Baml2006ReaderContext.cs
- SafeSecurityHandles.cs
- SerializableAttribute.cs
- ConfigXmlComment.cs
- Stack.cs
- PageAdapter.cs
- NullableDoubleAverageAggregationOperator.cs
- OperationContext.cs
- PropertyBuilder.cs
- _RequestCacheProtocol.cs
- RowBinding.cs
- AdornerPresentationContext.cs
- ListViewInsertEventArgs.cs
- SQLCharsStorage.cs
- NavigateEvent.cs
- Semaphore.cs
- CodeArrayCreateExpression.cs
- EndEvent.cs
- MessageParameterAttribute.cs
- ServicePointManager.cs
- InkCanvasInnerCanvas.cs
- BinaryReader.cs
- TextRangeEditTables.cs
- ConfigurationSectionGroup.cs
- ReliableMessagingVersion.cs
- TargetFrameworkAttribute.cs
- SingleAnimationUsingKeyFrames.cs
- Int16.cs
- CallSiteBinder.cs
- ObjectStateManager.cs
- PlaceHolder.cs
- SqlInternalConnectionTds.cs
- ArcSegment.cs
- StylusPlugin.cs
- TextTreeTextNode.cs
- ScrollBarRenderer.cs
- embossbitmapeffect.cs