IHtmlGenerator.GenerateActionLink 方法

定义

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

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

参数

viewContext
ViewContext

ViewContext当前范围的实例。

linkText
String

要插入元素内的文本。

actionName
String

操作方法的名称。

controllerName
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元素的<>实例。

适用于