HtmlHelper.RouteLink Metoda

Definicja

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

public:
 virtual Microsoft::AspNetCore::Html::IHtmlContent ^ RouteLink(System::String ^ linkText, System::String ^ routeName, System::String ^ protocol, System::String ^ hostName, System::String ^ fragment, System::Object ^ routeValues, System::Object ^ htmlAttributes);
public Microsoft.AspNetCore.Html.IHtmlContent RouteLink (string linkText, string routeName, string protocol, string hostName, string fragment, object routeValues, object htmlAttributes);
abstract member RouteLink : string * string * string * string * string * obj * obj -> Microsoft.AspNetCore.Html.IHtmlContent
override this.RouteLink : string * string * string * string * string * obj * obj -> Microsoft.AspNetCore.Html.IHtmlContent
Public Function RouteLink (linkText As String, routeName 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.

routeName
String

Nazwa trasy.

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.

Implementuje

Dotyczy