HtmlHelperExtensions.ResourceLink Method (HtmlHelper, String, String, Object, ActionType)
Generates a link to the resource controller, defaulting to the Retrieve action.
Namespace: Microsoft.Web.Mvc.Resources
Assembly: Microsoft.Web.Mvc (in Microsoft.Web.Mvc.dll)
Syntax
'Declaration
<ExtensionAttribute> _
Public Shared Function ResourceLink ( _
html As HtmlHelper, _
controllerName As String, _
linkText As String, _
routeValues As Object, _
actionType As ActionType _
) As MvcHtmlString
'Usage
Dim html As HtmlHelper
Dim controllerName As String
Dim linkText As String
Dim routeValues As Object
Dim actionType As ActionType
Dim returnValue As MvcHtmlString
returnValue = html.ResourceLink(controllerName, _
linkText, routeValues, actionType)
public static MvcHtmlString ResourceLink(
this HtmlHelper html,
string controllerName,
string linkText,
Object routeValues,
ActionType actionType
)
[ExtensionAttribute]
public:
static MvcHtmlString^ ResourceLink(
HtmlHelper^ html,
String^ controllerName,
String^ linkText,
Object^ routeValues,
ActionType actionType
)
static member ResourceLink :
html:HtmlHelper *
controllerName:string *
linkText:string *
routeValues:Object *
actionType:ActionType -> MvcHtmlString
public static function ResourceLink(
html : HtmlHelper,
controllerName : String,
linkText : String,
routeValues : Object,
actionType : ActionType
) : MvcHtmlString
Parameters
- html
Type: System.Web.Mvc.HtmlHelper
The html helper instance that this methods extends.
- controllerName
Type: System.String
The string controller name.
- linkText
Type: System.String
The link text.
- routeValues
Type: System.Object
An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax.
- actionType
Type: Microsoft.Web.Mvc.Resources.ActionType
The action type.
Return Value
Type: System.Web.Mvc.MvcHtmlString
A link to the resource controller.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type HtmlHelper. When you use instance method syntax to call this method, omit the first parameter. For more information, see https://msdn.microsoft.com/en-us/library/bb384936(v=vs.118) or https://msdn.microsoft.com/en-us/library/bb383977(v=vs.118).