IHtmlHelper.ActionLink Método

Definição

Retorna um elemento de âncora (<a>) que contém um caminho de URL para a ação especificada.

public:
 Microsoft::AspNetCore::Html::IHtmlContent ^ ActionLink(System::String ^ linkText, System::String ^ actionName, System::String ^ controllerName, System::String ^ protocol, System::String ^ hostname, System::String ^ fragment, System::Object ^ routeValues, System::Object ^ htmlAttributes);
public Microsoft.AspNetCore.Html.IHtmlContent ActionLink (string linkText, string actionName, string controllerName, string protocol, string hostname, string fragment, object routeValues, object htmlAttributes);
abstract member ActionLink : string * string * string * string * string * string * obj * obj -> Microsoft.AspNetCore.Html.IHtmlContent
Public Function ActionLink (linkText As String, actionName As String, controllerName As String, protocol As String, hostname As String, fragment As String, routeValues As Object, htmlAttributes As Object) As IHtmlContent

Parâmetros

linkText
String

O texto interno do elemento âncora. Não deve ser null.

actionName
String

O nome da ação.

controllerName
String

O nome do controlador.

protocol
String

O protocolo para a URL, como "http" ou "https".

hostname
String

O nome do host da URL.

fragment
String

O nome do fragmento de URL (o nome âncora).

routeValues
Object

Um Object que contém os parâmetros de uma rota. Os parâmetros são recuperados por meio da reflexão examinando as propriedades do Object. Normalmente Object , isso é criado usando Object a sintaxe do inicializador. Como alternativa, uma IDictionary<TKey,TValue> instância que contém os parâmetros de rota.

htmlAttributes
Object

Um Object que contém os atributos HTML para o elemento . Como alternativa, uma IDictionary<TKey,TValue> instância que contém os atributos HTML.

Retornos

Um novo IHtmlContent que contém o elemento anchor.

Aplica-se a