Udostępnij za pośrednictwem


UrlHelper.GenerateUrl Method (String, String, String, String, String, String, RouteValueDictionary, RouteCollection, RequestContext, Boolean)

Returns a string that contains a URL.

Namespace:  System.Web.Mvc
Assembly:  System.Web.Mvc (in System.Web.Mvc.dll)

Syntax

'Declaration
Public Shared Function GenerateUrl ( _
    routeName As String, _
    actionName As String, _
    controllerName As String, _
    protocol As String, _
    hostName As String, _
    fragment As String, _
    routeValues As RouteValueDictionary, _
    routeCollection As RouteCollection, _
    requestContext As RequestContext, _
    includeImplicitMvcValues As Boolean _
) As String
public static string GenerateUrl(
    string routeName,
    string actionName,
    string controllerName,
    string protocol,
    string hostName,
    string fragment,
    RouteValueDictionary routeValues,
    RouteCollection routeCollection,
    RequestContext requestContext,
    bool includeImplicitMvcValues
)
public:
static String^ GenerateUrl(
    String^ routeName, 
    String^ actionName, 
    String^ controllerName, 
    String^ protocol, 
    String^ hostName, 
    String^ fragment, 
    RouteValueDictionary^ routeValues, 
    RouteCollection^ routeCollection, 
    RequestContext^ requestContext, 
    bool includeImplicitMvcValues
)

Parameters

  • includeImplicitMvcValues
    Type: System.Boolean
    true to include implicit MVC values; otherwise false.

Return Value

Type: System.String
A string that contains a URL.

Remarks

There are two implicit MVC values, "action" and "controller".

See Also

Reference

UrlHelper Class

GenerateUrl Overload

System.Web.Mvc Namespace