Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / xsp / System / Web / UI / WebControls / SessionParameter.cs / 2 / 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
- XamlVector3DCollectionSerializer.cs
- ProgressChangedEventArgs.cs
- ActivityDesignerLayoutSerializers.cs
- FamilyCollection.cs
- Oid.cs
- ListBoxItemAutomationPeer.cs
- DataGridViewCellConverter.cs
- XmlEventCache.cs
- XmlStreamStore.cs
- OperationAbortedException.cs
- EditorAttribute.cs
- FontWeights.cs
- SQLBinary.cs
- TextCharacters.cs
- Tablet.cs
- ToolStripSplitStackLayout.cs
- SevenBitStream.cs
- TempEnvironment.cs
- XmlIlTypeHelper.cs
- ImageSource.cs
- RecognizedWordUnit.cs
- WebBrowserNavigatedEventHandler.cs
- SQLConvert.cs
- SizeValueSerializer.cs
- DiscoveryDocument.cs
- WebSysDescriptionAttribute.cs
- Cursor.cs
- OleDbPropertySetGuid.cs
- BufferModesCollection.cs
- ListCollectionView.cs
- ReturnEventArgs.cs
- OSFeature.cs
- TextEffectCollection.cs
- CacheModeConverter.cs
- XmlStringTable.cs
- DesignerSerializationVisibilityAttribute.cs
- TileModeValidation.cs
- UIntPtr.cs
- MultipleViewPattern.cs
- TimeEnumHelper.cs
- SweepDirectionValidation.cs
- MouseGestureConverter.cs
- RuntimeHandles.cs
- CrossContextChannel.cs
- PasswordRecovery.cs
- PageStatePersister.cs
- SessionStateSection.cs
- TreeNodeStyle.cs
- WebServiceClientProxyGenerator.cs
- RequestFactory.cs
- RefreshEventArgs.cs
- TextEmbeddedObject.cs
- ConstructorBuilder.cs
- EnumBuilder.cs
- LineSegment.cs
- ConfigurationCollectionAttribute.cs
- GridViewSelectEventArgs.cs
- PrintPreviewGraphics.cs
- LinkConverter.cs
- WpfXamlMember.cs
- MonikerBuilder.cs
- XMLSchema.cs
- LogLogRecordHeader.cs
- QuaternionAnimationBase.cs
- sqlstateclientmanager.cs
- TypeUsage.cs
- HierarchicalDataBoundControlAdapter.cs
- ActivityStatusChangeEventArgs.cs
- SemanticValue.cs
- objectquery_tresulttype.cs
- Converter.cs
- TextDecorationCollection.cs
- Rotation3DKeyFrameCollection.cs
- InitializationEventAttribute.cs
- XmlSchemaSet.cs
- SourceElementsCollection.cs
- RuntimeArgument.cs
- Context.cs
- EventLogTraceListener.cs
- SetterBaseCollection.cs
- KeyTimeConverter.cs
- SymbolType.cs
- TcpClientChannel.cs
- WinFormsSecurity.cs
- HttpProtocolReflector.cs
- MimePart.cs
- PageThemeParser.cs
- ClientBuildManager.cs
- ObjectAssociationEndMapping.cs
- ValidationResults.cs
- ResourceDefaultValueAttribute.cs
- PropertyChangeTracker.cs
- DispatcherExceptionFilterEventArgs.cs
- XamlTypeMapper.cs
- SqlExpander.cs
- ProviderConnectionPointCollection.cs
- PopupEventArgs.cs
- EncryptedKeyIdentifierClause.cs
- PolyQuadraticBezierSegment.cs
- DataSet.cs