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
- FamilyMap.cs
- RectKeyFrameCollection.cs
- WithStatement.cs
- DeviceSpecificChoiceCollection.cs
- PatternMatcher.cs
- SynchronizationLockException.cs
- ActiveXSite.cs
- DataKey.cs
- ScaleTransform3D.cs
- HistoryEventArgs.cs
- OleDbParameterCollection.cs
- IteratorDescriptor.cs
- MenuItem.cs
- RootBrowserWindow.cs
- RewritingValidator.cs
- ConstraintStruct.cs
- LicenseProviderAttribute.cs
- BaseDataBoundControl.cs
- EventWaitHandleSecurity.cs
- ValueExpressions.cs
- QuotedPrintableStream.cs
- DesignerActionUI.cs
- InstancePersistenceCommandException.cs
- embossbitmapeffect.cs
- ListViewInsertEventArgs.cs
- ListManagerBindingsCollection.cs
- BamlRecords.cs
- Permission.cs
- TypeBuilderInstantiation.cs
- XmlCharType.cs
- ProbeDuplexCD1AsyncResult.cs
- CalendarDateChangedEventArgs.cs
- TextSearch.cs
- MediaPlayer.cs
- MetricEntry.cs
- XmlNodeChangedEventArgs.cs
- UncommonField.cs
- DockPattern.cs
- ProxyDataContractResolver.cs
- IsolatedStorageSecurityState.cs
- SQLDecimalStorage.cs
- BitmapEffectDrawing.cs
- TypeGeneratedEventArgs.cs
- ProfessionalColors.cs
- SecurityNegotiationException.cs
- DESCryptoServiceProvider.cs
- GroupBoxRenderer.cs
- QueryOutputWriter.cs
- RecordBuilder.cs
- ProfessionalColorTable.cs
- Debug.cs
- SafeSecurityHandles.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- SortQuery.cs
- CommonGetThemePartSize.cs
- ArgumentNullException.cs
- XmlCodeExporter.cs
- CalendarModeChangedEventArgs.cs
- ListViewCancelEventArgs.cs
- DataGridColumnHeaderAutomationPeer.cs
- DataControlExtensions.cs
- SystemEvents.cs
- MetadataHelper.cs
- AttachedPropertyBrowsableForChildrenAttribute.cs
- SimpleParser.cs
- IdentityModelDictionary.cs
- WebProxyScriptElement.cs
- ScriptDescriptor.cs
- FilterElement.cs
- OperationAbortedException.cs
- DocumentViewerConstants.cs
- RevocationPoint.cs
- SplineKeyFrames.cs
- ThemeDirectoryCompiler.cs
- DataServiceContext.cs
- EdmSchemaError.cs
- Property.cs
- XmlSchemaSimpleTypeRestriction.cs
- SchemaContext.cs
- TypeUtils.cs
- ContextMenuStrip.cs
- DataObjectMethodAttribute.cs
- Int16Converter.cs
- ManagementEventWatcher.cs
- DesignerWithHeader.cs
- StateRuntime.cs
- VBCodeProvider.cs
- ValidationContext.cs
- RegexCompilationInfo.cs
- HashSet.cs
- DataGridState.cs
- FileUpload.cs
- DataContext.cs
- BaseProcessor.cs
- PropertyPushdownHelper.cs
- TraceUtils.cs
- SafeFileMappingHandle.cs
- FileDetails.cs
- CachedPathData.cs
- ApplicationHost.cs