RouteValueExpressionBuilder Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
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
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈