Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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.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. // //----------------------------------------------------------------------------- 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ExceptionUtil.cs
- NetworkInformationPermission.cs
- Assembly.cs
- Privilege.cs
- RecordConverter.cs
- DeviceContexts.cs
- WindowsToolbarAsMenu.cs
- XamlDebuggerXmlReader.cs
- OutKeywords.cs
- MaskedTextProvider.cs
- ElementMarkupObject.cs
- NamespaceCollection.cs
- XPathItem.cs
- LogicalTreeHelper.cs
- BaseTemplateCodeDomTreeGenerator.cs
- FontUnitConverter.cs
- AttachedPropertiesService.cs
- RegexFCD.cs
- CodeTypeDelegate.cs
- TypeSource.cs
- MaterialGroup.cs
- ActivityDesignerResources.cs
- XhtmlTextWriter.cs
- SecureUICommand.cs
- CryptographicAttribute.cs
- TextEndOfLine.cs
- StylusSystemGestureEventArgs.cs
- MessagePropertyFilter.cs
- LocalizationParserHooks.cs
- Header.cs
- StickyNoteHelper.cs
- XmlRawWriterWrapper.cs
- TextTreeTextNode.cs
- IssuedTokenClientCredential.cs
- PhysicalAddress.cs
- DependencyPropertyValueSerializer.cs
- QilGenerator.cs
- WebPartDisplayMode.cs
- RetrieveVirtualItemEventArgs.cs
- DataServiceSaveChangesEventArgs.cs
- Parser.cs
- Connector.cs
- CodePageUtils.cs
- ConfigurationManagerInternal.cs
- ElementHost.cs
- HttpProfileBase.cs
- CommonDialog.cs
- ObjectTag.cs
- PasswordRecoveryAutoFormat.cs
- ColorConvertedBitmapExtension.cs
- ReliableSessionElement.cs
- SqlGatherConsumedAliases.cs
- Debugger.cs
- NotificationContext.cs
- ExpressionBindingCollection.cs
- Message.cs
- SettingsPropertyValueCollection.cs
- VirtualizingStackPanel.cs
- EventMappingSettings.cs
- WebControlAdapter.cs
- FixedHyperLink.cs
- XMLUtil.cs
- IdleTimeoutMonitor.cs
- WindowsListViewSubItem.cs
- X509CertificateStore.cs
- MaskedTextBoxTextEditor.cs
- Label.cs
- BaseDataListActionList.cs
- SpeechUI.cs
- BitmapData.cs
- PolicyLevel.cs
- EventProviderWriter.cs
- XPathNodeHelper.cs
- NetWebProxyFinder.cs
- CodeAttributeArgumentCollection.cs
- CharEntityEncoderFallback.cs
- AddInContractAttribute.cs
- ExtractorMetadata.cs
- DataProviderNameConverter.cs
- Size.cs
- CustomErrorCollection.cs
- UniqueEventHelper.cs
- PrintEvent.cs
- SchemaSetCompiler.cs
- wmiprovider.cs
- SetterTriggerConditionValueConverter.cs
- DescriptionAttribute.cs
- Boolean.cs
- WorkflowInstanceQuery.cs
- PrintPageEvent.cs
- exports.cs
- RSACryptoServiceProvider.cs
- ReachIDocumentPaginatorSerializer.cs
- DispatcherOperation.cs
- HttpListenerPrefixCollection.cs
- Block.cs
- ProfessionalColorTable.cs
- ToolStripManager.cs
- RenderTargetBitmap.cs
- InteropAutomationProvider.cs