UrlHelperExtensions.Action 方法

定義

多載

Action(IUrlHelper)

產生 URL,其中包含動作方法的路徑。

Action(IUrlHelper, String)

產生 URL,其中包含指定 action 名稱的動作方法路徑。

Action(IUrlHelper, String, Object)

使用動作方法的路徑產生 URL,其中包含指定 action 的名稱和路由 values

Action(IUrlHelper, String, String)

產生具有動作方法路徑的 URL,其中包含指定的 actioncontroller 名稱。

Action(IUrlHelper, String, String, Object)

使用動作方法的路徑產生 URL,其中包含指定 action 的名稱、 controller 名稱和路由 values

Action(IUrlHelper, String, String, Object, String)

產生具有動作方法路徑的 URL,其中包含指定 action 的名稱、 controller 名稱、路由 valuesprotocol 要使用的 。 如需重要的安全性資訊,請參閱一節。

Action(IUrlHelper, String, String, Object, String, String)

使用動作方法的路徑產生 URL,其中包含要使用的指定 action 名稱、 controller 名稱、路由 valuesprotocolhost 名稱。 如果 protocolhost 不是, null 則會產生絕對 URL。 如需重要的安全性資訊,請參閱一節。

Action(IUrlHelper, String, String, Object, String, String, String)

使用動作方法的路徑產生 URL,其中包含指定 action 的名稱、 controller 名稱、路由 valuesfragmentprotocol 要使用的 URL、 host 名稱和 。 如果 protocolhost 不是, null 則會產生絕對 URL。 如需重要的安全性資訊,請參閱一節。

Action(IUrlHelper)

產生 URL,其中包含動作方法的路徑。

public:
[System::Runtime::CompilerServices::Extension]
 static System::String ^ Action(Microsoft::AspNetCore::Mvc::IUrlHelper ^ helper);
public static string Action (this Microsoft.AspNetCore.Mvc.IUrlHelper helper);
public static string? Action (this Microsoft.AspNetCore.Mvc.IUrlHelper helper);
static member Action : Microsoft.AspNetCore.Mvc.IUrlHelper -> string
<Extension()>
Public Function Action (helper As IUrlHelper) As String

參數

傳回

產生的 URL。

適用於

Action(IUrlHelper, String)

產生 URL,其中包含指定 action 名稱的動作方法路徑。

public:
[System::Runtime::CompilerServices::Extension]
 static System::String ^ Action(Microsoft::AspNetCore::Mvc::IUrlHelper ^ helper, System::String ^ action);
public static string Action (this Microsoft.AspNetCore.Mvc.IUrlHelper helper, string action);
public static string? Action (this Microsoft.AspNetCore.Mvc.IUrlHelper helper, string? action);
static member Action : Microsoft.AspNetCore.Mvc.IUrlHelper * string -> string
<Extension()>
Public Function Action (helper As IUrlHelper, action As String) As String

參數

action
String

動作方法的名稱。

傳回

產生的 URL。

適用於

Action(IUrlHelper, String, Object)

使用動作方法的路徑產生 URL,其中包含指定 action 的名稱和路由 values

public:
[System::Runtime::CompilerServices::Extension]
 static System::String ^ Action(Microsoft::AspNetCore::Mvc::IUrlHelper ^ helper, System::String ^ action, System::Object ^ values);
public static string Action (this Microsoft.AspNetCore.Mvc.IUrlHelper helper, string action, object values);
public static string? Action (this Microsoft.AspNetCore.Mvc.IUrlHelper helper, string? action, object? values);
static member Action : Microsoft.AspNetCore.Mvc.IUrlHelper * string * obj -> string
<Extension()>
Public Function Action (helper As IUrlHelper, action As String, values As Object) As String

參數

action
String

動作方法的名稱。

values
Object

包含路由值的物件。

傳回

產生的 URL。

適用於

Action(IUrlHelper, String, String)

產生具有動作方法路徑的 URL,其中包含指定的 actioncontroller 名稱。

public:
[System::Runtime::CompilerServices::Extension]
 static System::String ^ Action(Microsoft::AspNetCore::Mvc::IUrlHelper ^ helper, System::String ^ action, System::String ^ controller);
public static string Action (this Microsoft.AspNetCore.Mvc.IUrlHelper helper, string action, string controller);
public static string? Action (this Microsoft.AspNetCore.Mvc.IUrlHelper helper, string? action, string? controller);
static member Action : Microsoft.AspNetCore.Mvc.IUrlHelper * string * string -> string
<Extension()>
Public Function Action (helper As IUrlHelper, action As String, controller As String) As String

參數

action
String

動作方法的名稱。

controller
String

控制器的名稱。

傳回

產生的 URL。

適用於

Action(IUrlHelper, String, String, Object)

使用動作方法的路徑產生 URL,其中包含指定 action 的名稱、 controller 名稱和路由 values

public:
[System::Runtime::CompilerServices::Extension]
 static System::String ^ Action(Microsoft::AspNetCore::Mvc::IUrlHelper ^ helper, System::String ^ action, System::String ^ controller, System::Object ^ values);
public static string Action (this Microsoft.AspNetCore.Mvc.IUrlHelper helper, string action, string controller, object values);
public static string? Action (this Microsoft.AspNetCore.Mvc.IUrlHelper helper, string? action, string? controller, object? values);
static member Action : Microsoft.AspNetCore.Mvc.IUrlHelper * string * string * obj -> string
<Extension()>
Public Function Action (helper As IUrlHelper, action As String, controller As String, values As Object) As String

參數

action
String

動作方法的名稱。

controller
String

控制器的名稱。

values
Object

包含路由值的物件。

傳回

產生的 URL。

適用於

Action(IUrlHelper, String, String, Object, String)

產生具有動作方法路徑的 URL,其中包含指定 action 的名稱、 controller 名稱、路由 valuesprotocol 要使用的 。 如需重要的安全性資訊,請參閱一節。

public:
[System::Runtime::CompilerServices::Extension]
 static System::String ^ Action(Microsoft::AspNetCore::Mvc::IUrlHelper ^ helper, System::String ^ action, System::String ^ controller, System::Object ^ values, System::String ^ protocol);
public static string Action (this Microsoft.AspNetCore.Mvc.IUrlHelper helper, string action, string controller, object values, string protocol);
public static string? Action (this Microsoft.AspNetCore.Mvc.IUrlHelper helper, string? action, string? controller, object? values, string? protocol);
static member Action : Microsoft.AspNetCore.Mvc.IUrlHelper * string * string * obj * string -> string
<Extension()>
Public Function Action (helper As IUrlHelper, action As String, controller As String, values As Object, protocol As String) As String

參數

action
String

動作方法的名稱。

controller
String

控制器的名稱。

values
Object

包含路由值的物件。

protocol
String

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

傳回

產生的 URL。

備註

這個方法會使用 的值 Host 來填入所產生 URI 的主機區段。 除非已驗證標頭,否則 Host 依賴目前要求的值可允許不受信任的輸入影響產生的 URI。 如需如何在部署環境中正確驗證 Host 標頭的指示,請參閱部署檔。

適用於

Action(IUrlHelper, String, String, Object, String, String)

使用動作方法的路徑產生 URL,其中包含要使用的指定 action 名稱、 controller 名稱、路由 valuesprotocolhost 名稱。 如果 protocolhost 不是, null 則會產生絕對 URL。 如需重要的安全性資訊,請參閱一節。

public:
[System::Runtime::CompilerServices::Extension]
 static System::String ^ Action(Microsoft::AspNetCore::Mvc::IUrlHelper ^ helper, System::String ^ action, System::String ^ controller, System::Object ^ values, System::String ^ protocol, System::String ^ host);
public static string Action (this Microsoft.AspNetCore.Mvc.IUrlHelper helper, string action, string controller, object values, string protocol, string host);
public static string? Action (this Microsoft.AspNetCore.Mvc.IUrlHelper helper, string? action, string? controller, object? values, string? protocol, string? host);
static member Action : Microsoft.AspNetCore.Mvc.IUrlHelper * string * string * obj * string * string -> string
<Extension()>
Public Function Action (helper As IUrlHelper, action As String, controller As String, values As Object, protocol As String, host As String) As String

參數

action
String

動作方法的名稱。

controller
String

控制器的名稱。

values
Object

包含路由值的物件。

protocol
String

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

host
String

URL 的主機名稱。

傳回

產生的 URL。

備註

的值 host 應該是受信任的值。 除非已驗證標頭,否則 Host 依賴目前要求的值可允許不受信任的輸入影響產生的 URI。 如需如何在部署環境中正確驗證 Host 標頭的指示,請參閱部署檔。

適用於

Action(IUrlHelper, String, String, Object, String, String, String)

使用動作方法的路徑產生 URL,其中包含指定 action 的名稱、 controller 名稱、路由 valuesfragmentprotocol 要使用的 URL、 host 名稱和 。 如果 protocolhost 不是, null 則會產生絕對 URL。 如需重要的安全性資訊,請參閱一節。

public:
[System::Runtime::CompilerServices::Extension]
 static System::String ^ Action(Microsoft::AspNetCore::Mvc::IUrlHelper ^ helper, System::String ^ action, System::String ^ controller, System::Object ^ values, System::String ^ protocol, System::String ^ host, System::String ^ fragment);
public static string Action (this Microsoft.AspNetCore.Mvc.IUrlHelper helper, string action, string controller, object values, string protocol, string host, string fragment);
public static string? Action (this Microsoft.AspNetCore.Mvc.IUrlHelper helper, string? action, string? controller, object? values, string? protocol, string? host, string? fragment);
static member Action : Microsoft.AspNetCore.Mvc.IUrlHelper * string * string * obj * string * string * string -> string
<Extension()>
Public Function Action (helper As IUrlHelper, action As String, controller As String, values As Object, protocol As String, host As String, fragment As String) As String

參數

action
String

動作方法的名稱。

controller
String

控制器的名稱。

values
Object

包含路由值的物件。

protocol
String

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

host
String

URL 的主機名稱。

fragment
String

URL 的片段。

傳回

產生的 URL。

備註

的值 host 應該是受信任的值。 除非已驗證標頭,否則 Host 依賴目前要求的值可允許不受信任的輸入影響產生的 URI。 如需如何在部署環境中正確驗證 Host 標頭的指示,請參閱部署檔。

適用於