Uređivanje

Dijeli putem


RouteValueExpressionBuilder Class

Definition

Retrieves the value that corresponds to a specified URL parameter in a routed page.

public ref class RouteValueExpressionBuilder : System::Web::Compilation::ExpressionBuilder
public class RouteValueExpressionBuilder : System.Web.Compilation.ExpressionBuilder
type RouteValueExpressionBuilder = class
    inherit ExpressionBuilder
Public Class RouteValueExpressionBuilder
Inherits ExpressionBuilder
Inheritance
RouteValueExpressionBuilder

Examples

The following example shows how to use markup to display the value of the URL parameter searchterm. The route is defined by using http://www.contoso.com/search/{searchterm} as the URL pattern.

<asp:Label ID="Label1" runat="server"
    text="<%$ RouteValue:searchterm %>">
</asp:Label>

If the page is requested with the URL http://www.contoso.com/search/Bicycles, the Label control displays "Bicycles".

Remarks

The RouteValueExpressionBuilder class makes it possible to use markup to set the property of a server control to the value of one of the URL parameters in a routed page.

Constructors

RouteValueExpressionBuilder()

Initializes a new instance of the RouteValueExpressionBuilder class.

Properties

SupportsEvaluate

Gets a value that indicates whether an expression can be evaluated in a page that is not compiled.

Methods

Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
EvaluateExpression(Object, BoundPropertyEntry, Object, ExpressionBuilderContext)

Retrieves the value that corresponds to a specified route key.

GetCodeExpression(BoundPropertyEntry, Object, ExpressionBuilderContext)

Returns a code expression that is used to perform the property assignment in the generated page class.

GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetRouteValue(Page, String, Type, String)

Retrieves the value that corresponds to the specified URL parameter.

GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ParseExpression(String, Type, ExpressionBuilderContext)

When overridden in a derived class, returns an object that represents the parsed expression.

(Inherited from ExpressionBuilder)
ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to

See also