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
- LinqDataSourceContextEventArgs.cs
- Slider.cs
- DiagnosticTrace.cs
- DefaultSettingsSection.cs
- HttpWebRequestElement.cs
- ClassHandlersStore.cs
- TableColumnCollection.cs
- BamlLocalizerErrorNotifyEventArgs.cs
- PolicyException.cs
- IPEndPoint.cs
- PeerCustomResolverSettings.cs
- ExpressionBindingCollection.cs
- ForeignKeyConstraint.cs
- DesignerSerializationVisibilityAttribute.cs
- AlphaSortedEnumConverter.cs
- SignatureHelper.cs
- SelectedDatesCollection.cs
- TextRangeEdit.cs
- XmlBinaryReader.cs
- IImplicitResourceProvider.cs
- MouseEvent.cs
- InputLangChangeRequestEvent.cs
- ForAllOperator.cs
- InProcStateClientManager.cs
- FileLoadException.cs
- ScalarType.cs
- CompModSwitches.cs
- TextDecoration.cs
- FocusManager.cs
- ControlUtil.cs
- DecimalStorage.cs
- _BufferOffsetSize.cs
- ColorBlend.cs
- EdmComplexTypeAttribute.cs
- FileLevelControlBuilderAttribute.cs
- TypeToken.cs
- DNS.cs
- XmlSerializerFactory.cs
- ObjectCloneHelper.cs
- Positioning.cs
- coordinatorfactory.cs
- OracleConnectionString.cs
- LayoutManager.cs
- DetailsViewUpdatedEventArgs.cs
- VariantWrapper.cs
- RecordConverter.cs
- RSAPKCS1SignatureFormatter.cs
- ListViewGroup.cs
- SqlRecordBuffer.cs
- SplitterDesigner.cs
- _NestedMultipleAsyncResult.cs
- WebPartActionVerb.cs
- SelectedDatesCollection.cs
- HitTestParameters.cs
- QueryStringParameter.cs
- RegexStringValidatorAttribute.cs
- XmlHierarchicalEnumerable.cs
- JpegBitmapEncoder.cs
- Main.cs
- ModuleConfigurationInfo.cs
- HotSpotCollection.cs
- MsmqIntegrationValidationBehavior.cs
- StreamFormatter.cs
- FileUtil.cs
- RelAssertionDirectKeyIdentifierClause.cs
- TabControlCancelEvent.cs
- Empty.cs
- RewritingProcessor.cs
- SBCSCodePageEncoding.cs
- WinFormsSecurity.cs
- ButtonBaseAdapter.cs
- ProfilePropertySettingsCollection.cs
- WeakEventTable.cs
- TraceContextEventArgs.cs
- UnmanagedMemoryStreamWrapper.cs
- EncoderNLS.cs
- HwndMouseInputProvider.cs
- NavigatingCancelEventArgs.cs
- UnsafeNativeMethods.cs
- AppliedDeviceFiltersDialog.cs
- DataSourceComponent.cs
- ConnectionStringsExpressionBuilder.cs
- RSAPKCS1SignatureDeformatter.cs
- MobileComponentEditorPage.cs
- TrackingProfileDeserializationException.cs
- DispatchChannelSink.cs
- ArraySegment.cs
- ResourceAssociationSetEnd.cs
- InputQueueChannel.cs
- EdmConstants.cs
- CodeCatchClause.cs
- TypographyProperties.cs
- MarginsConverter.cs
- DataGridViewRowConverter.cs
- DesignerRegionMouseEventArgs.cs
- SymmetricAlgorithm.cs
- OverflowException.cs
- TdsParserStaticMethods.cs
- RichTextBoxConstants.cs
- WebPartTracker.cs