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
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- StrongNameMembershipCondition.cs
- SecureUICommand.cs
- SendSecurityHeaderElement.cs
- HelloOperation11AsyncResult.cs
- Comparer.cs
- BufferedStream.cs
- CancelEventArgs.cs
- RenamedEventArgs.cs
- RelationshipNavigation.cs
- TaskScheduler.cs
- FontCacheUtil.cs
- Vector3DCollectionConverter.cs
- ZipIOCentralDirectoryBlock.cs
- SqlError.cs
- ToolStripHighContrastRenderer.cs
- ToolStripSettings.cs
- PasswordRecovery.cs
- EventLogPermission.cs
- Add.cs
- DecoderFallback.cs
- DataServiceRequestOfT.cs
- _NestedMultipleAsyncResult.cs
- XmlSchemaAttributeGroupRef.cs
- SmiContext.cs
- ConditionalDesigner.cs
- EntityDataSourceConfigureObjectContext.cs
- Set.cs
- ZipIOFileItemStream.cs
- Win32PrintDialog.cs
- ExtensionDataObject.cs
- AppDomainFactory.cs
- HasCopySemanticsAttribute.cs
- CacheForPrimitiveTypes.cs
- CodeTypeDelegate.cs
- Pair.cs
- TemplateControlBuildProvider.cs
- OdbcConnection.cs
- DefaultAsyncDataDispatcher.cs
- ITextView.cs
- ExtentKey.cs
- HttpConfigurationSystem.cs
- HwndHostAutomationPeer.cs
- storepermissionattribute.cs
- DbProviderSpecificTypePropertyAttribute.cs
- BindableAttribute.cs
- CombinedGeometry.cs
- MailMessage.cs
- TextChangedEventArgs.cs
- AnnotationObservableCollection.cs
- Model3D.cs
- XmlSchemaExternal.cs
- Transform3D.cs
- ComplusTypeValidator.cs
- RSAPKCS1KeyExchangeFormatter.cs
- XmlDataDocument.cs
- JsonGlobals.cs
- RoutingConfiguration.cs
- WebColorConverter.cs
- GetPageNumberCompletedEventArgs.cs
- WebZone.cs
- GroupQuery.cs
- AssemblySettingAttributes.cs
- ProviderManager.cs
- SqlGenericUtil.cs
- WebMessageEncodingElement.cs
- DataDocumentXPathNavigator.cs
- UpDownEvent.cs
- BufferedGraphics.cs
- TreeNodeBinding.cs
- HttpSocketManager.cs
- FormatControl.cs
- ParserOptions.cs
- FactoryGenerator.cs
- WindowsIPAddress.cs
- DataControlLinkButton.cs
- DynamicObjectAccessor.cs
- FixedTextBuilder.cs
- XmlSerializerNamespaces.cs
- ExpressionBindingCollection.cs
- DivideByZeroException.cs
- ProfileService.cs
- OleDbError.cs
- ValueUnavailableException.cs
- TableItemStyle.cs
- ObjectViewListener.cs
- PerfService.cs
- PixelShader.cs
- Nullable.cs
- CharacterBufferReference.cs
- _ShellExpression.cs
- DateTimeValueSerializer.cs
- OleDbReferenceCollection.cs
- SecurityBindingElementImporter.cs
- LogEntryHeaderSerializer.cs
- DocumentViewerConstants.cs
- ValueUnavailableException.cs
- QilScopedVisitor.cs
- TypefaceMap.cs
- SystemParameters.cs
- AuthenticatedStream.cs