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
- CodeAttributeDeclaration.cs
- XmlQueryType.cs
- StateRuntime.cs
- BitmapEffectDrawingContent.cs
- BamlStream.cs
- HtmlFormWrapper.cs
- CompModHelpers.cs
- PrinterSettings.cs
- SettingsProperty.cs
- GridItemCollection.cs
- EncoderParameters.cs
- Quaternion.cs
- Regex.cs
- XmlQueryTypeFactory.cs
- DefaultEventAttribute.cs
- CompositeTypefaceMetrics.cs
- CrossAppDomainChannel.cs
- TypeConverterHelper.cs
- EntityDataSourceChangedEventArgs.cs
- CatalogPartChrome.cs
- ArcSegment.cs
- ToolboxComponentsCreatedEventArgs.cs
- UnsafeNativeMethods.cs
- HtmlInputHidden.cs
- COM2FontConverter.cs
- CellPartitioner.cs
- SerialErrors.cs
- ConcurrentQueue.cs
- Timer.cs
- ActivityDesignerAccessibleObject.cs
- KeySplineConverter.cs
- Rect3DConverter.cs
- NamedPipeTransportElement.cs
- CompressStream.cs
- _DynamicWinsockMethods.cs
- TypeUtil.cs
- XPathException.cs
- SizeValueSerializer.cs
- XsltQilFactory.cs
- ErrorEventArgs.cs
- LocatorBase.cs
- CallSiteOps.cs
- WriterOutput.cs
- SiteMapPath.cs
- SqlDataSourceCache.cs
- ListenerElementsCollection.cs
- TextSearch.cs
- CommandTreeTypeHelper.cs
- messageonlyhwndwrapper.cs
- Control.cs
- HashCodeCombiner.cs
- ExtractedStateEntry.cs
- LinkUtilities.cs
- PageAsyncTaskManager.cs
- DbProviderConfigurationHandler.cs
- ByteFacetDescriptionElement.cs
- LinqDataSourceDeleteEventArgs.cs
- SqlTypesSchemaImporter.cs
- XmlQualifiedNameTest.cs
- NameNode.cs
- PanningMessageFilter.cs
- PageParserFilter.cs
- TypeInfo.cs
- NavigatorOutput.cs
- DispatcherFrame.cs
- SqlFunctionAttribute.cs
- ZipIOFileItemStream.cs
- ClickablePoint.cs
- ActivityDelegate.cs
- ToggleButton.cs
- PopupEventArgs.cs
- SqlParameter.cs
- CodeMemberField.cs
- TextChangedEventArgs.cs
- WriteFileContext.cs
- ViewCellSlot.cs
- DataRelationCollection.cs
- RoleService.cs
- ImageKeyConverter.cs
- FunctionImportMapping.cs
- SqlMethodAttribute.cs
- EntityCommandDefinition.cs
- TreeBuilder.cs
- XmlAttribute.cs
- PolyQuadraticBezierSegmentFigureLogic.cs
- ToolboxComponentsCreatingEventArgs.cs
- ResourceAttributes.cs
- EncryptedKey.cs
- FileVersion.cs
- RtfNavigator.cs
- HMACSHA384.cs
- BackgroundWorker.cs
- VisualStyleRenderer.cs
- WindowsRichEditRange.cs
- ManagedFilter.cs
- BamlCollectionHolder.cs
- MenuItemBindingCollection.cs
- PkcsUtils.cs
- StopStoryboard.cs
- GlyphRun.cs