IHtmlGenerator.GenerateRouteLink Metodo
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Generare un <> elemento per un collegamento a un'azione.
public:
Microsoft::AspNetCore::Mvc::Rendering::TagBuilder ^ GenerateRouteLink(Microsoft::AspNetCore::Mvc::Rendering::ViewContext ^ viewContext, System::String ^ linkText, System::String ^ routeName, System::String ^ protocol, System::String ^ hostName, System::String ^ fragment, System::Object ^ routeValues, System::Object ^ htmlAttributes);
public Microsoft.AspNetCore.Mvc.Rendering.TagBuilder GenerateRouteLink (Microsoft.AspNetCore.Mvc.Rendering.ViewContext viewContext, string linkText, string routeName, string protocol, string hostName, string fragment, object routeValues, object htmlAttributes);
abstract member GenerateRouteLink : Microsoft.AspNetCore.Mvc.Rendering.ViewContext * string * string * string * string * string * obj * obj -> Microsoft.AspNetCore.Mvc.Rendering.TagBuilder
Public Function GenerateRouteLink (viewContext As ViewContext, linkText As String, routeName As String, protocol As String, hostName As String, fragment As String, routeValues As Object, htmlAttributes As Object) As TagBuilder
- viewContext
- ViewContext
ViewContext Istanza dell'ambito corrente.
- linkText
- String
Testo da inserire all'interno dell'elemento.
- routeName
- String
Nome della route da utilizzare per la generazione di collegamenti.
- protocol
- String
Protocollo (schema) per il collegamento generato.
- hostName
- String
Nome host per il collegamento generato.
- fragment
- String
Frammento per il collegamento generato.
- routeValues
- Object
Oggetto Object contenente i parametri per una route. I parametri vengono recuperati tramite reflection esaminando le proprietà di Object. Viene Object in genere creato usando Object la sintassi dell'inizializzatore. In alternativa, un'istanza IDictionary<TKey,TValue> contenente i parametri di route.
- htmlAttributes
- Object
Oggetto Object contenente gli attributi HTML per l'elemento . In alternativa, un'istanza IDictionary<TKey,TValue> contenente gli attributi HTML.
TagBuilder Istanza di per un <> elemento .
Prodotto | Versioni |
---|---|
ASP.NET Core | 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0 |