Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / UI / WebControls / SessionParameter.cs / 1305376 / SessionParameter.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.WebControls { using System; using System.ComponentModel; using System.Data; ////// Represents a Parameter that gets its value from the application's session state. /// [ DefaultProperty("SessionField"), ] 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 internal 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
- ArraySortHelper.cs
- HandlerBase.cs
- BinaryObjectWriter.cs
- HiddenField.cs
- ArgumentNullException.cs
- ProviderBase.cs
- NamedPipeChannelListener.cs
- ISCIIEncoding.cs
- IndividualDeviceConfig.cs
- GeneralTransform3DTo2DTo3D.cs
- CqlQuery.cs
- CompilerGlobalScopeAttribute.cs
- EventLogPermissionAttribute.cs
- Guid.cs
- PerfProviderCollection.cs
- OciLobLocator.cs
- ExtendedPropertiesHandler.cs
- TextEditor.cs
- CodeCompiler.cs
- MimeParameter.cs
- OdbcStatementHandle.cs
- OLEDB_Enum.cs
- SharedConnectionWorkflowTransactionService.cs
- UnSafeCharBuffer.cs
- DBSqlParserColumn.cs
- QueryCacheKey.cs
- Expression.cs
- CodeArgumentReferenceExpression.cs
- ForwardPositionQuery.cs
- ItemChangedEventArgs.cs
- XmlDesignerDataSourceView.cs
- OracleCommand.cs
- OdbcReferenceCollection.cs
- COAUTHINFO.cs
- HTTPRemotingHandler.cs
- LocalFileSettingsProvider.cs
- XsltSettings.cs
- ReadOnlyDictionary.cs
- util.cs
- TextEffect.cs
- KnownBoxes.cs
- SqlParameterizer.cs
- SqlVisitor.cs
- HandlerFactoryCache.cs
- NamedObject.cs
- EventData.cs
- VectorCollectionValueSerializer.cs
- BaseProcessor.cs
- AssociationType.cs
- WindowsTab.cs
- IriParsingElement.cs
- SqlMetaData.cs
- ContentElement.cs
- HttpHeaderCollection.cs
- InkPresenterAutomationPeer.cs
- DataGridColumn.cs
- ActiveXSite.cs
- MailMessageEventArgs.cs
- UserPersonalizationStateInfo.cs
- TextAnchor.cs
- ResourceReferenceKeyNotFoundException.cs
- DecoderReplacementFallback.cs
- HyperLinkColumn.cs
- SoapInteropTypes.cs
- TransactionContextValidator.cs
- LineBreakRecord.cs
- ZoomPercentageConverter.cs
- UnsafeNativeMethods.cs
- XmlMemberMapping.cs
- HtmlInputImage.cs
- IApplicationTrustManager.cs
- DuplicateWaitObjectException.cs
- ValidatorCollection.cs
- DbConnectionFactory.cs
- StylusPointProperty.cs
- HandlerMappingMemo.cs
- ValueType.cs
- SqlBulkCopy.cs
- MessageQueueException.cs
- DataControlButton.cs
- IntSecurity.cs
- SQLInt16Storage.cs
- XamlToRtfWriter.cs
- EntityKeyElement.cs
- XmlBinaryReader.cs
- ClickablePoint.cs
- LinkLabel.cs
- VScrollProperties.cs
- DrawingBrush.cs
- HtmlEmptyTagControlBuilder.cs
- EntityDataSourceStatementEditor.cs
- ExternalFile.cs
- DataGridViewColumnEventArgs.cs
- PassportAuthenticationModule.cs
- MSHTMLHost.cs
- CodeTypeReference.cs
- TrustManagerPromptUI.cs
- Model3D.cs
- ObjectQuery_EntitySqlExtensions.cs
- EntityDataSourceWrapper.cs