Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / ndp / fx / src / xsp / System / Web / UI / WebControls / SessionParameter.cs / 2 / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- XmlName.cs
- TableCellCollection.cs
- InnerItemCollectionView.cs
- TextElement.cs
- NoneExcludedImageIndexConverter.cs
- TraceSwitch.cs
- XmlCodeExporter.cs
- InputProviderSite.cs
- DeviceSpecific.cs
- UnaryExpression.cs
- StoreConnection.cs
- PropertyChangeTracker.cs
- MailWriter.cs
- DataGridViewRowDividerDoubleClickEventArgs.cs
- HttpRequestCacheValidator.cs
- OdbcUtils.cs
- TextTreeObjectNode.cs
- HtmlCommandAdapter.cs
- MemoryResponseElement.cs
- ObjectItemNoOpAssemblyLoader.cs
- GridViewUpdatedEventArgs.cs
- KeyMatchBuilder.cs
- VisualBasicSettingsHandler.cs
- MarginsConverter.cs
- ListBoxItemWrapperAutomationPeer.cs
- PageHandlerFactory.cs
- Sequence.cs
- DBDataPermission.cs
- ByteStack.cs
- recordstate.cs
- ToolboxItemCollection.cs
- CachingHintValidation.cs
- Message.cs
- CodeNamespaceCollection.cs
- ParseElement.cs
- ZipIOLocalFileHeader.cs
- XmlAttributeOverrides.cs
- UpDownEvent.cs
- ToolStripRendererSwitcher.cs
- ListBindingHelper.cs
- Registry.cs
- QuaternionRotation3D.cs
- NotSupportedException.cs
- ListControl.cs
- BooleanSwitch.cs
- FlowDocumentFormatter.cs
- TTSEngineProxy.cs
- QueueSurrogate.cs
- RSAOAEPKeyExchangeFormatter.cs
- MenuItemStyle.cs
- ManualResetEvent.cs
- DynamicRendererThreadManager.cs
- GridViewRowCollection.cs
- ResourcePropertyMemberCodeDomSerializer.cs
- SerialReceived.cs
- Size.cs
- Match.cs
- counter.cs
- SecureConversationServiceElement.cs
- InvokeMethodActivity.cs
- Vector3DKeyFrameCollection.cs
- GPPOINT.cs
- Vector3DAnimationBase.cs
- login.cs
- XmlSchemaObjectTable.cs
- DetailsViewPagerRow.cs
- UpDownBase.cs
- Oid.cs
- ToolTip.cs
- AsyncOperation.cs
- InkCanvas.cs
- CopyEncoder.cs
- SharedPersonalizationStateInfo.cs
- FormViewUpdatedEventArgs.cs
- DesignerAutoFormatCollection.cs
- DataSysAttribute.cs
- XamlBuildTaskServices.cs
- DetailsViewDeleteEventArgs.cs
- XPathException.cs
- RsaKeyIdentifierClause.cs
- controlskin.cs
- ProviderUtil.cs
- SiteMapNodeItemEventArgs.cs
- ToolboxItemCollection.cs
- ControlBindingsConverter.cs
- XmlBaseReader.cs
- EqualityComparer.cs
- SortKey.cs
- SchemaType.cs
- AttributedMetaModel.cs
- CodeTypeReference.cs
- SqlOuterApplyReducer.cs
- StyleCollectionEditor.cs
- MouseActionValueSerializer.cs
- XmlComplianceUtil.cs
- ObjectContextServiceProvider.cs
- TextTreeRootTextBlock.cs
- MarkupExtensionParser.cs
- JsonWriter.cs
- ToolStripDropDownMenu.cs