Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / 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.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, 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]; } } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SafeLibraryHandle.cs
- IconHelper.cs
- TextTreeText.cs
- QueryCacheEntry.cs
- TimelineGroup.cs
- SqlRowUpdatingEvent.cs
- EraserBehavior.cs
- HatchBrush.cs
- FormsAuthenticationEventArgs.cs
- ScriptResourceInfo.cs
- MeasurementDCInfo.cs
- ExtenderProvidedPropertyAttribute.cs
- ListSourceHelper.cs
- SelectingProviderEventArgs.cs
- ResourceReferenceExpression.cs
- ClosureBinding.cs
- InstanceLockQueryResult.cs
- SinglePageViewer.cs
- SmtpReplyReader.cs
- ResourceReader.cs
- VerificationException.cs
- Speller.cs
- AsyncContentLoadedEventArgs.cs
- ContextQuery.cs
- BamlLocalizationDictionary.cs
- SafeMILHandle.cs
- ThaiBuddhistCalendar.cs
- UiaCoreApi.cs
- DataGridViewTopRowAccessibleObject.cs
- WebProxyScriptElement.cs
- ArraySet.cs
- SR.cs
- ProfileServiceManager.cs
- DesignerTransaction.cs
- AttachInfo.cs
- NoClickablePointException.cs
- AsymmetricAlgorithm.cs
- sqlser.cs
- TriState.cs
- _NativeSSPI.cs
- Token.cs
- DecoderNLS.cs
- DataSourceGroupCollection.cs
- AddDataControlFieldDialog.cs
- UpWmlMobileTextWriter.cs
- GuidConverter.cs
- SecurityTimestamp.cs
- HtmlControlAdapter.cs
- _ServiceNameStore.cs
- ClientData.cs
- VerificationException.cs
- ZipIORawDataFileBlock.cs
- BuildTopDownAttribute.cs
- FeatureAttribute.cs
- WorkflowElementDialogWindow.xaml.cs
- IdnMapping.cs
- SecureStringHasher.cs
- AnonymousIdentificationModule.cs
- GridToolTip.cs
- ListControl.cs
- DBAsyncResult.cs
- IconBitmapDecoder.cs
- DynamicDocumentPaginator.cs
- AutomationPropertyInfo.cs
- MaxSessionCountExceededException.cs
- DeviceContexts.cs
- RichTextBox.cs
- ForEachDesigner.xaml.cs
- WebPartMinimizeVerb.cs
- SelectedDatesCollection.cs
- Encoder.cs
- EdmSchemaError.cs
- UriSection.cs
- DependencyPropertyConverter.cs
- DiagnosticsElement.cs
- ResXResourceSet.cs
- UnsafeNativeMethods.cs
- OfTypeExpression.cs
- EncryptedPackage.cs
- SystemTcpConnection.cs
- ObjectTag.cs
- DynamicRenderer.cs
- OrderedHashRepartitionStream.cs
- DBParameter.cs
- DataGridViewRowPrePaintEventArgs.cs
- _ListenerAsyncResult.cs
- MediaPlayer.cs
- PerformanceCounterPermission.cs
- unsafeIndexingFilterStream.cs
- SqlWebEventProvider.cs
- CellTreeNodeVisitors.cs
- WebPartExportVerb.cs
- DesignerVerbCollection.cs
- SingleConverter.cs
- WebPartUserCapability.cs
- ResourceSetExpression.cs
- StyleSheetDesigner.cs
- InstallerTypeAttribute.cs
- DbMetaDataCollectionNames.cs
- HttpStreamFormatter.cs