IHtmlGenerator.GenerateRouteLink 方法

定义

< >为操作的链接生成元素。

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当前范围的实例。

linkText
String

要插入元素内的文本。

routeName
String

要用于生成链接的路由的名称。

protocol
String

生成的链接的协议 (方案) 。

hostName
String

生成的链接的主机名。

fragment
String

生成的链接的片段。

routeValues
Object

一个 Object 包含路由参数的 。 通过检查 的属性 Object,通过反射检索参数。 这 Object 通常是使用 Object 初始值设定项语法创建的。 或者,一个 IDictionary<TKey,TValue> 包含路由参数的实例。

htmlAttributes
Object

一个 Object ,它包含 元素的 HTML 属性。 或者,一个 IDictionary<TKey,TValue> 包含 HTML 属性的实例。

返回

TagBuilder元素的<>实例。

适用于