Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / xsp / System / Web / UI / WebControls / CookieParameter.cs / 1 / CookieParameter.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 request parameters. /// [ DefaultProperty("CookieName"), ] [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] [AspNetHostingPermission(SecurityAction.InheritanceDemand, Level=AspNetHostingPermissionLevel.Minimal)] public class CookieParameter : Parameter { ////// Creates an instance of the CookieParameter class. /// public CookieParameter() { } ////// Creates an instance of the CookieParameter class with the specified parameter name and request field. /// public CookieParameter(string name, string cookieName) : base(name) { CookieName = cookieName; } ////// Creates an instance of the CookieParameter class with the specified parameter name, type, and request field. /// public CookieParameter(string name, TypeCode type, string cookieName) : base(name, type) { CookieName = cookieName; } ////// Used to clone a parameter. /// protected CookieParameter(CookieParameter original) : base(original) { CookieName = original.CookieName; } ////// The name of the request parameter to get the value from. /// [ DefaultValue(""), WebCategory("Parameter"), WebSysDescription(SR.CookieParameter_CookieName), ] public string CookieName { get { object o = ViewState["CookieName"]; if (o == null) return String.Empty; return (string)o; } set { if (CookieName != value) { ViewState["CookieName"] = value; OnParameterChanged(); } } } ////// Creates a new CookieParameter that is a copy of this CookieParameter. /// protected override Parameter Clone() { return new CookieParameter(this); } ////// Returns the updated value of the parameter. /// protected override object Evaluate(HttpContext context, Control control) { if (context == null || context.Request == null) { return null; } HttpCookie cookie = context.Request.Cookies[CookieName]; if (cookie == null) { return null; } return cookie.Value; } } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Configuration.cs
- SafeEventLogReadHandle.cs
- BooleanConverter.cs
- CompressEmulationStream.cs
- RichTextBoxContextMenu.cs
- CellNormalizer.cs
- HyperLinkColumn.cs
- DebugInfoExpression.cs
- UnknownBitmapEncoder.cs
- versioninfo.cs
- HtmlInputControl.cs
- FragmentQueryProcessor.cs
- CmsUtils.cs
- RootBuilder.cs
- ColumnClickEvent.cs
- LoginView.cs
- updatecommandorderer.cs
- Timer.cs
- LinqDataSource.cs
- IntersectQueryOperator.cs
- TextDecorationCollection.cs
- OdbcUtils.cs
- RegisterInfo.cs
- HttpTransportBindingElement.cs
- LogLogRecord.cs
- XPathArrayIterator.cs
- LinqDataSource.cs
- RayHitTestParameters.cs
- PartialCachingAttribute.cs
- CodeDefaultValueExpression.cs
- SelectionProviderWrapper.cs
- FontStretch.cs
- DbProviderFactories.cs
- HintTextConverter.cs
- XmlSignificantWhitespace.cs
- CodeObject.cs
- Variant.cs
- DataBindingCollection.cs
- CurrentTimeZone.cs
- CounterCreationDataConverter.cs
- StringUtil.cs
- MetadataCacheItem.cs
- HttpWebResponse.cs
- ServerIdentity.cs
- ConfigXmlComment.cs
- ProgressBarHighlightConverter.cs
- DataTablePropertyDescriptor.cs
- PreservationFileReader.cs
- CloudCollection.cs
- RegistryPermission.cs
- UnicodeEncoding.cs
- LinqDataSourceContextEventArgs.cs
- AnnotationStore.cs
- CqlLexer.cs
- SystemIPAddressInformation.cs
- FontNamesConverter.cs
- XmlBinaryReader.cs
- DirectoryNotFoundException.cs
- XmlMessageFormatter.cs
- ChineseLunisolarCalendar.cs
- OutputCacheProfile.cs
- Int16KeyFrameCollection.cs
- XmlTypeAttribute.cs
- WmlTextViewAdapter.cs
- MatrixCamera.cs
- PropertyFilter.cs
- DivideByZeroException.cs
- DataContractFormatAttribute.cs
- InvokeMethodDesigner.xaml.cs
- MediaElementAutomationPeer.cs
- CultureTable.cs
- StrongNamePublicKeyBlob.cs
- TemplatedAdorner.cs
- Propagator.ExtentPlaceholderCreator.cs
- XmlReflectionMember.cs
- CompositeTypefaceMetrics.cs
- CoTaskMemHandle.cs
- ObjectNavigationPropertyMapping.cs
- ObfuscateAssemblyAttribute.cs
- EnumUnknown.cs
- SqlUserDefinedTypeAttribute.cs
- GeneralTransform.cs
- QuaternionConverter.cs
- Delegate.cs
- Region.cs
- CodeAttributeArgument.cs
- OverlappedAsyncResult.cs
- HwndMouseInputProvider.cs
- HttpListenerException.cs
- QilParameter.cs
- BookmarkTable.cs
- ListViewInsertionMark.cs
- XsdValidatingReader.cs
- Propagator.cs
- SoapCodeExporter.cs
- versioninfo.cs
- DrawingDrawingContext.cs
- EnumerableCollectionView.cs
- HttpModulesInstallComponent.cs
- PageThemeCodeDomTreeGenerator.cs