Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / UI / WebControls / RouteParameter.cs / 1305376 / RouteParameter.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; using System.Web.Routing; ////// Represents a Parameter that gets its value from the application's route data. /// [ DefaultProperty("RouteKey"), ] public class RouteParameter : Parameter { ////// Creates an instance of the RouteParameter class. /// public RouteParameter() { } ////// Creates an instance of the RouteParameter class with the specified parameter name and request field. /// public RouteParameter(string name, string routeKey) : base(name) { RouteKey = routeKey; } ////// Creates an instance of the routeParameter class with the specified parameter name, database type, and /// request field. /// public RouteParameter(string name, DbType dbType, string routeKey) : base(name, dbType) { RouteKey = routeKey; } ////// Creates an instance of the RouteParameter class with the specified parameter name, type, and request field. /// public RouteParameter(string name, TypeCode type, string routeKey) : base(name, type) { RouteKey = routeKey; } ////// Used to clone a parameter. /// protected RouteParameter(RouteParameter original) : base(original) { RouteKey = original.RouteKey; } ////// The name of the route value to get the value from. /// [ DefaultValue(""), WebCategory("Parameter"), WebSysDescription(SR.RouteParameter_RouteKey), ] public string RouteKey { get { object o = ViewState["RouteKey"]; if (o == null) return String.Empty; return (string)o; } set { if (RouteKey != value) { ViewState["RouteKey"] = value; OnParameterChanged(); } } } ////// Creates a new RouteParameter that is a copy of this RouteParameter. /// protected override Parameter Clone() { return new RouteParameter(this); } ////// Returns the updated value of the parameter. /// protected internal override object Evaluate(HttpContext context, Control control) { if (context == null || context.Request == null || control == null) { return null; } RouteData routeData = control.Page.RouteData; if (routeData == null) { return null; } return routeData.Values[RouteKey]; } } } // 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; using System.Security.Permissions; using System.Web.Routing; ////// Represents a Parameter that gets its value from the application's route data. /// [ DefaultProperty("RouteKey"), ] public class RouteParameter : Parameter { ////// Creates an instance of the RouteParameter class. /// public RouteParameter() { } ////// Creates an instance of the RouteParameter class with the specified parameter name and request field. /// public RouteParameter(string name, string routeKey) : base(name) { RouteKey = routeKey; } ////// Creates an instance of the routeParameter class with the specified parameter name, database type, and /// request field. /// public RouteParameter(string name, DbType dbType, string routeKey) : base(name, dbType) { RouteKey = routeKey; } ////// Creates an instance of the RouteParameter class with the specified parameter name, type, and request field. /// public RouteParameter(string name, TypeCode type, string routeKey) : base(name, type) { RouteKey = routeKey; } ////// Used to clone a parameter. /// protected RouteParameter(RouteParameter original) : base(original) { RouteKey = original.RouteKey; } ////// The name of the route value to get the value from. /// [ DefaultValue(""), WebCategory("Parameter"), WebSysDescription(SR.RouteParameter_RouteKey), ] public string RouteKey { get { object o = ViewState["RouteKey"]; if (o == null) return String.Empty; return (string)o; } set { if (RouteKey != value) { ViewState["RouteKey"] = value; OnParameterChanged(); } } } ////// Creates a new RouteParameter that is a copy of this RouteParameter. /// protected override Parameter Clone() { return new RouteParameter(this); } ////// Returns the updated value of the parameter. /// protected internal override object Evaluate(HttpContext context, Control control) { if (context == null || context.Request == null || control == null) { return null; } RouteData routeData = control.Page.RouteData; if (routeData == null) { return null; } return routeData.Values[RouteKey]; } } } // 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
- SqlStream.cs
- PropVariant.cs
- TypeUtil.cs
- HttpWebResponse.cs
- GlobalItem.cs
- ProcessHostFactoryHelper.cs
- InternalCache.cs
- WebRequestModuleElementCollection.cs
- GB18030Encoding.cs
- PopupControlService.cs
- FormViewPageEventArgs.cs
- AccessDataSource.cs
- SqlXml.cs
- DefaultObjectMappingItemCollection.cs
- SizeAnimationBase.cs
- XPathNavigatorReader.cs
- UriTemplateQueryValue.cs
- EpmSyndicationContentDeSerializer.cs
- InvalidBodyAccessException.cs
- ColorMap.cs
- Panel.cs
- MatrixUtil.cs
- WmiEventSink.cs
- DataServiceExpressionVisitor.cs
- SqlProviderUtilities.cs
- CompositeDesignerAccessibleObject.cs
- CookieProtection.cs
- TdsValueSetter.cs
- HtmlWindowCollection.cs
- ImportCatalogPart.cs
- HwndHostAutomationPeer.cs
- WindowsGraphics2.cs
- DataObjectFieldAttribute.cs
- EventTrigger.cs
- SchemaTypeEmitter.cs
- DataListDesigner.cs
- DataPager.cs
- WorkflowMarkupSerializationProvider.cs
- XmlSerializerNamespaces.cs
- Int32CAMarshaler.cs
- TextSelection.cs
- Privilege.cs
- RecipientInfo.cs
- StreamGeometryContext.cs
- ContentPlaceHolder.cs
- AVElementHelper.cs
- AssemblyHelper.cs
- NodeFunctions.cs
- PartManifestEntry.cs
- XPathPatternBuilder.cs
- FixedPosition.cs
- _AuthenticationState.cs
- WsdlBuildProvider.cs
- ConnectionStringsExpressionBuilder.cs
- BitVector32.cs
- RuntimeHelpers.cs
- InboundActivityHelper.cs
- OleDbCommand.cs
- ExclusiveTcpTransportManager.cs
- EntityCollection.cs
- WeakReferenceList.cs
- ToolStripRendererSwitcher.cs
- InProcStateClientManager.cs
- WorkflowValidationFailedException.cs
- ReadOnlyAttribute.cs
- StateInitializationDesigner.cs
- DoubleAverageAggregationOperator.cs
- LoadRetryConstantStrategy.cs
- WebPartConnectionsEventArgs.cs
- PeekCompletedEventArgs.cs
- TimeEnumHelper.cs
- CodeDOMProvider.cs
- Semaphore.cs
- StringHandle.cs
- SmtpMail.cs
- EqualityComparer.cs
- ReplacementText.cs
- ListSourceHelper.cs
- RoleService.cs
- IPPacketInformation.cs
- CodeAttributeDeclarationCollection.cs
- ListControl.cs
- basecomparevalidator.cs
- _CookieModule.cs
- Geometry3D.cs
- PackagePart.cs
- TypefaceMetricsCache.cs
- IgnoreFileBuildProvider.cs
- HtmlElementErrorEventArgs.cs
- KeyManager.cs
- CalendarDateRangeChangingEventArgs.cs
- ListItem.cs
- PartialTrustHelpers.cs
- XmlMembersMapping.cs
- DiscoveryDocument.cs
- PerformanceCounterLib.cs
- XomlCompiler.cs
- WebPartMenu.cs
- SafeNativeMethods.cs
- CodeConstructor.cs