Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- TypefaceMetricsCache.cs
- VirtualDirectoryMapping.cs
- KnownBoxes.cs
- FlowLayoutPanel.cs
- ValidatingReaderNodeData.cs
- AccessibleObject.cs
- TimeSpanValidatorAttribute.cs
- Thread.cs
- ArglessEventHandlerProxy.cs
- MessageSecurityTokenVersion.cs
- CorrelationActionMessageFilter.cs
- UnionExpr.cs
- OleDbFactory.cs
- IsolatedStorage.cs
- SecurityPolicySection.cs
- ObjectNotFoundException.cs
- Repeater.cs
- RegistryKey.cs
- WindowsProgressbar.cs
- DefaultTraceListener.cs
- TableRowCollection.cs
- CookielessHelper.cs
- WindowsFormsSynchronizationContext.cs
- UnsafeNativeMethods.cs
- MemberBinding.cs
- IPGlobalProperties.cs
- InfoCardListRequest.cs
- PackageRelationshipSelector.cs
- RSAPKCS1KeyExchangeFormatter.cs
- DisposableCollectionWrapper.cs
- SelectionService.cs
- Compensation.cs
- AliasExpr.cs
- DataViewSetting.cs
- SqlPersonalizationProvider.cs
- FontConverter.cs
- BitmapScalingModeValidation.cs
- ConfigurationValues.cs
- EndpointAddress10.cs
- DbgUtil.cs
- ExecutionContext.cs
- AttachedAnnotationChangedEventArgs.cs
- StatusBarItem.cs
- ContentType.cs
- DataTableExtensions.cs
- OleDbPermission.cs
- EntityCommandDefinition.cs
- DayRenderEvent.cs
- TrustLevel.cs
- HopperCache.cs
- DescendantQuery.cs
- CodeSnippetExpression.cs
- DragSelectionMessageFilter.cs
- SystemDropShadowChrome.cs
- UIElement3D.cs
- XmlNodeComparer.cs
- _ProxyRegBlob.cs
- LoginDesigner.cs
- EventHandlers.cs
- MtomMessageEncodingElement.cs
- ServicePointManagerElement.cs
- httpapplicationstate.cs
- DragDeltaEventArgs.cs
- DependentTransaction.cs
- Thread.cs
- DecimalFormatter.cs
- Cell.cs
- LineBreak.cs
- CoTaskMemSafeHandle.cs
- WebRequestModuleElement.cs
- QilScopedVisitor.cs
- Content.cs
- XdrBuilder.cs
- BaseEntityWrapper.cs
- XmlBaseReader.cs
- ListItemCollection.cs
- XPathChildIterator.cs
- BindUriHelper.cs
- MetadataItemEmitter.cs
- CachedPathData.cs
- SqlDataSourceWizardForm.cs
- StringExpressionSet.cs
- AuthorizationPolicyTypeElement.cs
- MediaTimeline.cs
- CompilerWrapper.cs
- AsyncResult.cs
- WebPartDisplayMode.cs
- FormViewDeleteEventArgs.cs
- SpeakInfo.cs
- Italic.cs
- PropertiesTab.cs
- PrivilegedConfigurationManager.cs
- Int32CollectionValueSerializer.cs
- HashCoreRequest.cs
- ProxyManager.cs
- BooleanProjectedSlot.cs
- _RequestLifetimeSetter.cs
- CounterSample.cs
- InheritanceContextChangedEventManager.cs
- ServiceDescription.cs