IHtmlGenerator.GenerateActionLink Méthode

Définition

Générez un <> élément pour un lien vers une action.

public:
 Microsoft::AspNetCore::Mvc::Rendering::TagBuilder ^ GenerateActionLink(Microsoft::AspNetCore::Mvc::Rendering::ViewContext ^ viewContext, 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.Mvc.Rendering.TagBuilder GenerateActionLink (Microsoft.AspNetCore.Mvc.Rendering.ViewContext viewContext, string linkText, string actionName, string controllerName, string protocol, string hostname, string fragment, object routeValues, object htmlAttributes);
abstract member GenerateActionLink : Microsoft.AspNetCore.Mvc.Rendering.ViewContext * string * string * string * string * string * string * obj * obj -> Microsoft.AspNetCore.Mvc.Rendering.TagBuilder
Public Function GenerateActionLink (viewContext As ViewContext, 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 TagBuilder

Paramètres

viewContext
ViewContext

Le ViewContext instance pour l’étendue actuelle.

linkText
String

Texte à insérer à l’intérieur de l’élément.

actionName
String

Nom de la méthode d’action.

controllerName
String

Nom du contrôleur.

protocol
String

Protocole (schéma) pour le lien généré.

hostname
String

Nom d’hôte du lien généré.

fragment
String

Fragment du lien généré.

routeValues
Object

Object qui contient les paramètres d’un itinéraire. Les paramètres sont récupérés par réflexion en examinant les propriétés de .Object Il Object est généralement créé à l’aide de Object la syntaxe d’initialiseur. Vous pouvez également utiliser une IDictionary<TKey,TValue> instance contenant les paramètres de route.

htmlAttributes
Object

Object qui contient les attributs HTML de l’élément . IDictionary<TKey,TValue> Une instance contenant les attributs HTML.

Retours

Une TagBuilder instance pour l’élément <a>.

S’applique à