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 實例 <> 。

適用於