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)

'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
'Usage
Dim routeName As String 
Dim actionName As String 
Dim controllerName As String 
Dim protocol As String 
Dim hostName As String 
Dim fragment As String 
Dim routeValues As RouteValueDictionary 
Dim routeCollection As RouteCollection 
Dim requestContext As RequestContext 
Dim includeImplicitMvcValues As Boolean 
Dim returnValue As String 

returnValue = UrlHelper.GenerateUrl(routeName, _
	actionName, controllerName, protocol, _
	hostName, fragment, routeValues, _
	routeCollection, requestContext, _
	includeImplicitMvcValues)

Parameters

routeName
Type: System.String

The route name.

actionName
Type: System.String

The action name.

controllerName
Type: System.String

The controller name.

protocol
Type: System.String

The HTTP protocol.

hostName
Type: System.String

The host name.

fragment
Type: System.String

The fragment.

routeValues
Type: System.Web.Routing.RouteValueDictionary

The route values.

routeCollection
Type: System.Web.Routing.RouteCollection

The route collection.

requestContext
Type: System.Web.Routing.RequestContext

The request context.

includeImplicitMvcValues
Type: System.Boolean

true to include implicit MVC values; otherwise false.

Return Value

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

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

Show: