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
- TaskForm.cs
- Transactions.cs
- Rotation3DAnimationBase.cs
- MessageQueueTransaction.cs
- SafeSystemMetrics.cs
- DataListItem.cs
- ChannelBinding.cs
- ComponentSerializationService.cs
- DebugView.cs
- DesignerToolboxInfo.cs
- RemoteWebConfigurationHost.cs
- Encoder.cs
- MessageQueuePermissionEntry.cs
- RegexFCD.cs
- PageSettings.cs
- ManagedCodeMarkers.cs
- XmlSerializationGeneratedCode.cs
- StateMachineDesignerPaint.cs
- DataGridViewTopRowAccessibleObject.cs
- TextEffectResolver.cs
- ServiceCredentials.cs
- AttachedPropertyBrowsableAttribute.cs
- XmlSchemaSimpleContent.cs
- FlowLayoutSettings.cs
- AssemblyInfo.cs
- ParseNumbers.cs
- Int16Animation.cs
- Vector3DAnimation.cs
- BindingFormattingDialog.cs
- WebPartVerb.cs
- ClientSettingsSection.cs
- HttpDictionary.cs
- PageCache.cs
- SplineQuaternionKeyFrame.cs
- TimeSpanConverter.cs
- ConversionContext.cs
- ControlPropertyNameConverter.cs
- Variant.cs
- BackoffTimeoutHelper.cs
- MetadataFile.cs
- ReachPrintTicketSerializer.cs
- LambdaValue.cs
- OrderablePartitioner.cs
- Version.cs
- ToolStripItemDataObject.cs
- TableRow.cs
- ToolStripPanelCell.cs
- NavigateEvent.cs
- ValidationVisibilityAttribute.cs
- DropDownButton.cs
- DrawingImage.cs
- EntityDataSourceMemberPath.cs
- GeneralTransform3DCollection.cs
- FormsAuthenticationTicket.cs
- MessageAction.cs
- ResetableIterator.cs
- MessageLoggingElement.cs
- AssemblyResourceLoader.cs
- DataGridColumn.cs
- ControlBindingsCollection.cs
- HttpApplication.cs
- Context.cs
- MembershipPasswordException.cs
- SurrogateSelector.cs
- SynchronizedDispatch.cs
- TextDecorationUnitValidation.cs
- SchemaMapping.cs
- CodePageEncoding.cs
- KnownColorTable.cs
- RequestResizeEvent.cs
- ColumnCollection.cs
- ChangeTracker.cs
- DeclaredTypeElement.cs
- RuntimeIdentifierPropertyAttribute.cs
- ActivationArguments.cs
- HttpCacheVary.cs
- DataSourceXmlSerializer.cs
- AppendHelper.cs
- KnownTypesProvider.cs
- PersistenceTypeAttribute.cs
- AddDataControlFieldDialog.cs
- TextParaLineResult.cs
- DataGridViewCellStyleContentChangedEventArgs.cs
- TagMapInfo.cs
- TimeStampChecker.cs
- VisualBasic.cs
- StringConverter.cs
- StrokeIntersection.cs
- XmlAutoDetectWriter.cs
- WebEventTraceProvider.cs
- BackgroundWorker.cs
- ToolboxComponentsCreatingEventArgs.cs
- UTF7Encoding.cs
- ToolStripItemDataObject.cs
- TimeEnumHelper.cs
- BuildManagerHost.cs
- _ChunkParse.cs
- BlurEffect.cs
- InternalConfigHost.cs
- webclient.cs