This documentation is archived and is not being maintained.
RouteUrlExpressionBuilder::GetRouteUrl Method
Visual Studio 2010
Creates a URL that corresponds to specified route keys for a route URL format.
Assembly: System.Web (in System.Web.dll)
Parameters
- control
- Type: System.Web.UI::Control
The control that the expression is bound to.
- expression
- Type: System::String
The expression as specified in markup.
Return Value
Type: System::StringThe URL that corresponds to the route URL format of the current Route object.
| Exception | Condition |
|---|---|
| ArgumentNullException | The control parameter is nullptr. |
| InvalidOperationException | The method was unable to parse the expression that was specified in markup. For more information, see TryParseRouteExpression. |
This method generates the appropriate value for the URL by calling the GetVirtualPath method of the RouteCollection object. It gets the RequestContext object from the control parameter, and it parses the route name and route parameters from the expression parameter.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: