IHtmlHelper.ActionLink Metoda

Definicja

Zwraca element kotwicy (<a>), który zawiera ścieżkę adresu URL do określonej akcji.

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

Parametry

linkText
String

Tekst wewnętrzny elementu kotwicy. Nie może być null.

actionName
String

Nazwa akcji.

controllerName
String

Nazwa kontrolera.

protocol
String

Protokół adresu URL, taki jak "http" lub "https".

hostname
String

Nazwa hosta adresu URL.

fragment
String

Nazwa fragmentu adresu URL (nazwa kotwicy).

routeValues
Object

Element Object zawierający parametry trasy. Parametry są pobierane przez odbicie, sprawdzając właściwości elementu Object. Jest to Object zwykle tworzone przy użyciu Object składni inicjatora. Alternatywnie IDictionary<TKey,TValue> wystąpienie zawierające parametry trasy.

htmlAttributes
Object

Element Object zawierający atrybuty HTML elementu. Alternatywnie IDictionary<TKey,TValue> wystąpienie zawierające atrybuty HTML.

Zwraca

Nowy IHtmlContent element zawierający element kotwicy.

Dotyczy