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
- SettingsPropertyNotFoundException.cs
- ActivityDesigner.cs
- ReferenceTypeElement.cs
- HierarchicalDataSourceConverter.cs
- WebMethodAttribute.cs
- FolderBrowserDialog.cs
- mediapermission.cs
- TypeInitializationException.cs
- NavigateEvent.cs
- XmlSchemaInfo.cs
- IntermediatePolicyValidator.cs
- SecurityListenerSettingsLifetimeManager.cs
- ToolStripDesignerAvailabilityAttribute.cs
- RegexReplacement.cs
- ConnectionPoint.cs
- EventWaitHandleSecurity.cs
- StackSpiller.Temps.cs
- securitymgrsite.cs
- Point3D.cs
- CodeGroup.cs
- SymmetricKeyWrap.cs
- ComboBox.cs
- CreatingCookieEventArgs.cs
- DrawingAttributesDefaultValueFactory.cs
- TrustManagerMoreInformation.cs
- CustomWebEventKey.cs
- SurrogateSelector.cs
- OdbcConnection.cs
- TextChangedEventArgs.cs
- WindowsToolbar.cs
- GeneralTransform3DGroup.cs
- TdsParser.cs
- XmlJsonWriter.cs
- HitTestWithGeometryDrawingContextWalker.cs
- AutomationElement.cs
- FullTextLine.cs
- DispatcherObject.cs
- BulletedListEventArgs.cs
- XmlILModule.cs
- OpenFileDialog.cs
- PackagePart.cs
- TemplatePropertyEntry.cs
- NullableIntAverageAggregationOperator.cs
- PassportAuthenticationModule.cs
- CfgArc.cs
- SoapReflectionImporter.cs
- RichTextBoxAutomationPeer.cs
- ToolStripDropDownItem.cs
- XmlSchemaAnnotation.cs
- ButtonBaseAutomationPeer.cs
- ExpressionBuilderContext.cs
- IODescriptionAttribute.cs
- HttpListenerException.cs
- StringSorter.cs
- AggregationMinMaxHelpers.cs
- RuleValidation.cs
- FixedPageProcessor.cs
- TreeNodeCollectionEditor.cs
- ConsoleKeyInfo.cs
- StringValidator.cs
- DesignerProperties.cs
- FileLoadException.cs
- Crypto.cs
- EncodingInfo.cs
- OdbcTransaction.cs
- DatagridviewDisplayedBandsData.cs
- XsltCompileContext.cs
- ComponentDispatcher.cs
- MultiView.cs
- HasCopySemanticsAttribute.cs
- InternalResources.cs
- XmlCharType.cs
- WinEventWrap.cs
- ThreadAbortException.cs
- Inflater.cs
- RoutedEventValueSerializer.cs
- _AuthenticationState.cs
- __ConsoleStream.cs
- XmlArrayItemAttribute.cs
- RoleGroupCollection.cs
- XmlArrayItemAttribute.cs
- ContextMenuStripActionList.cs
- InvalidAsynchronousStateException.cs
- OrderedDictionary.cs
- _ListenerRequestStream.cs
- filewebresponse.cs
- TokenBasedSet.cs
- XmlQueryOutput.cs
- SmiMetaDataProperty.cs
- UniqueConstraint.cs
- ListViewItemSelectionChangedEvent.cs
- WmlLabelAdapter.cs
- XmlSchemaObjectTable.cs
- ComponentEditorForm.cs
- ContextStaticAttribute.cs
- StrokeCollection2.cs
- Stream.cs
- SafeProcessHandle.cs
- AccessText.cs
- WSFederationHttpBinding.cs