Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / UI / WebControls / CookieParameter.cs / 1305376 / CookieParameter.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.WebControls { using System; using System.ComponentModel; using System.Data; ////// Represents a Parameter that gets its value from the application's request parameters. /// [ DefaultProperty("CookieName"), ] 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, database type, and /// request field. /// public CookieParameter(string name, DbType dbType, string cookieName) : base(name, dbType) { 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 internal 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; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.WebControls { using System; using System.ComponentModel; using System.Data; ////// Represents a Parameter that gets its value from the application's request parameters. /// [ DefaultProperty("CookieName"), ] 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, database type, and /// request field. /// public CookieParameter(string name, DbType dbType, string cookieName) : base(name, dbType) { 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 internal 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; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- RawStylusActions.cs
- PropertyPath.cs
- WebSysDefaultValueAttribute.cs
- DataGridViewCheckBoxCell.cs
- EntityContainerEmitter.cs
- Optimizer.cs
- FrugalMap.cs
- StickyNote.cs
- EncoderReplacementFallback.cs
- GeneralTransform3DGroup.cs
- Errors.cs
- SafeNativeMethods.cs
- DbConnectionPoolOptions.cs
- CompilerScopeManager.cs
- KeyInfo.cs
- Drawing.cs
- AdornerHitTestResult.cs
- AlphabeticalEnumConverter.cs
- HierarchicalDataBoundControl.cs
- EpmTargetTree.cs
- BitmapEffectInputConnector.cs
- XmlCDATASection.cs
- Point4D.cs
- AsyncStreamReader.cs
- ConvertBinder.cs
- ValidationException.cs
- DesignOnlyAttribute.cs
- HttpWebRequestElement.cs
- TypeInformation.cs
- EntityUtil.cs
- RelativeSource.cs
- DbMetaDataFactory.cs
- LocalBuilder.cs
- Utilities.cs
- BindingExpressionUncommonField.cs
- CodeEntryPointMethod.cs
- DataColumn.cs
- TemplateXamlTreeBuilder.cs
- CustomGrammar.cs
- ShaderEffect.cs
- CustomSignedXml.cs
- IconHelper.cs
- BitmapFrameEncode.cs
- WebPartCatalogCloseVerb.cs
- ValueTypeFixupInfo.cs
- LinkLabelLinkClickedEvent.cs
- RemotingAttributes.cs
- QueryStringParameter.cs
- WebPartConnection.cs
- SizeConverter.cs
- CapabilitiesRule.cs
- itemelement.cs
- KerberosTicketHashIdentifierClause.cs
- HtmlEncodedRawTextWriter.cs
- DataProviderNameConverter.cs
- DiscoveryClientDocuments.cs
- GridViewPageEventArgs.cs
- SqlCacheDependencyDatabase.cs
- COM2Properties.cs
- DataPagerFieldItem.cs
- MemberMaps.cs
- SystemIPGlobalProperties.cs
- ProcessHostMapPath.cs
- ApplicationSecurityManager.cs
- MdImport.cs
- ViewGenerator.cs
- GeneralTransform3DGroup.cs
- ParserContext.cs
- XmlUrlResolver.cs
- CodePageUtils.cs
- BitmapCodecInfoInternal.cs
- SqlDataSourceStatusEventArgs.cs
- _DigestClient.cs
- WebRequestModulesSection.cs
- Rijndael.cs
- RawStylusInput.cs
- OpacityConverter.cs
- TextViewSelectionProcessor.cs
- CodeExporter.cs
- DataPager.cs
- ProfileManager.cs
- ThrowHelper.cs
- PingOptions.cs
- RangeValidator.cs
- IdentityReference.cs
- IisTraceListener.cs
- DBAsyncResult.cs
- SAPIEngineTypes.cs
- SessionIDManager.cs
- RichTextBoxAutomationPeer.cs
- ScriptResourceDefinition.cs
- __FastResourceComparer.cs
- OperationPickerDialog.designer.cs
- CompilerScopeManager.cs
- TrackingServices.cs
- VisualStyleRenderer.cs
- ModelToObjectValueConverter.cs
- UnsafeNativeMethods.cs
- PropertyDescriptorGridEntry.cs
- MemoryFailPoint.cs