IHtmlHelper.ActionLink 方法

定義

傳回錨點 (<> 包含指定動作 URL 路徑的) 專案。

public:
 Microsoft::AspNetCore::Html::IHtmlContent ^ ActionLink(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.Html.IHtmlContent ActionLink (string linkText, string actionName, string controllerName, string protocol, string hostname, string fragment, object routeValues, object htmlAttributes);
abstract member ActionLink : string * string * string * string * string * string * obj * obj -> Microsoft.AspNetCore.Html.IHtmlContent
Public Function ActionLink (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 IHtmlContent

參數

linkText
String

錨定項目的內部文字。 必須不是 null

actionName
String

動作的名稱。

controllerName
String

控制器的名稱。

protocol
String

URL 的通訊協定,例如 "http" 或 "https"。

hostname
String

URL 的主機名稱。

fragment
String

URL 片段名稱 (錨定名稱)。

routeValues
Object

Object,包含路由的參數。 參數會透過反映來擷取,方法是檢查 的屬性 Object 。 這 Object 通常是使用 Object 初始化運算式語法所建立。 或者, IDictionary<TKey,TValue> 包含路由參數的實例。

htmlAttributes
Object

Object,其中包含 專案的 HTML 屬性。 或者, IDictionary<TKey,TValue> 包含 HTML 屬性的實例。

傳回

新的 IHtmlContent ,其中包含錨點專案。

適用於