Code:
/ FX-1434 / FX-1434 / 1.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
- ListViewInsertedEventArgs.cs
- SqlConnectionHelper.cs
- Token.cs
- ClientData.cs
- ProcessHostMapPath.cs
- Keyboard.cs
- CodeFieldReferenceExpression.cs
- SmiEventSink_DeferedProcessing.cs
- SiteMapNodeCollection.cs
- ByteRangeDownloader.cs
- OpCellTreeNode.cs
- SqlNotificationEventArgs.cs
- connectionpool.cs
- SafeNativeMethodsOther.cs
- XmlSchemaSimpleContent.cs
- TextCompositionEventArgs.cs
- StyleCollectionEditor.cs
- DetailsViewModeEventArgs.cs
- InputLanguageManager.cs
- COM2AboutBoxPropertyDescriptor.cs
- AcceleratedTokenProviderState.cs
- ActivityDesigner.cs
- MediaTimeline.cs
- contentDescriptor.cs
- ObjectDataSourceView.cs
- PersonalizableTypeEntry.cs
- Selector.cs
- SymbolPair.cs
- ObjectListCommandsPage.cs
- __Error.cs
- bidPrivateBase.cs
- OletxVolatileEnlistment.cs
- ReachDocumentReferenceSerializer.cs
- TraceListener.cs
- ParsedAttributeCollection.cs
- LocatorPartList.cs
- ObjectIDGenerator.cs
- QueryCreatedEventArgs.cs
- UpdateEventArgs.cs
- ContourSegment.cs
- CategoryNameCollection.cs
- GuidelineSet.cs
- ApplicationProxyInternal.cs
- AddInAdapter.cs
- ManualResetEvent.cs
- MailMessageEventArgs.cs
- ToolStripScrollButton.cs
- LabelLiteral.cs
- DataSourceView.cs
- ListCollectionView.cs
- SafeEventLogReadHandle.cs
- Visual3D.cs
- x509utils.cs
- StrongNameMembershipCondition.cs
- SecurityBindingElementImporter.cs
- PenThreadPool.cs
- LingerOption.cs
- StringPropertyBuilder.cs
- DelayDesigner.cs
- RequestResizeEvent.cs
- XmlAnyElementAttribute.cs
- CalendarDateRangeChangingEventArgs.cs
- ConnectionManagementElement.cs
- LoginViewDesigner.cs
- Soap.cs
- MDIControlStrip.cs
- Int16Converter.cs
- WindowShowOrOpenTracker.cs
- InfoCardRSAOAEPKeyExchangeDeformatter.cs
- WebServiceEnumData.cs
- SecUtil.cs
- UnsafeCollabNativeMethods.cs
- UrlParameterWriter.cs
- SessionEndedEventArgs.cs
- ContentElementAutomationPeer.cs
- TextServicesHost.cs
- ModelPerspective.cs
- HtmlPhoneCallAdapter.cs
- Serializer.cs
- DataServiceExpressionVisitor.cs
- RecordManager.cs
- FrameworkContentElement.cs
- HotCommands.cs
- HttpApplication.cs
- PerfService.cs
- ImageKeyConverter.cs
- ResourceSet.cs
- CompilerInfo.cs
- LifetimeServices.cs
- OutputCacheModule.cs
- DateBoldEvent.cs
- XsltOutput.cs
- objectquery_tresulttype.cs
- InputEventArgs.cs
- TableCellAutomationPeer.cs
- BindingContext.cs
- CryptoStream.cs
- ContextMarshalException.cs
- WinEventQueueItem.cs
- DisplayInformation.cs