UrlHelperExtensions.Action 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
| Action(IUrlHelper) |
產生 URL,其中包含動作方法的路徑。 |
| Action(IUrlHelper, String) |
產生 URL,其中包含指定 |
| Action(IUrlHelper, String, Object) |
使用動作方法的路徑產生 URL,其中包含指定 |
| Action(IUrlHelper, String, String) |
產生具有動作方法路徑的 URL,其中包含指定的 |
| Action(IUrlHelper, String, String, Object) |
使用動作方法的路徑產生 URL,其中包含指定 |
| Action(IUrlHelper, String, String, Object, String) |
產生具有動作方法路徑的 URL,其中包含指定 |
| Action(IUrlHelper, String, String, Object, String, String) |
使用動作方法的路徑產生 URL,其中包含要使用的指定 |
| Action(IUrlHelper, String, String, Object, String, String, String) |
使用動作方法的路徑產生 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
參數
- helper
- IUrlHelper
傳回
產生的 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
參數
- helper
- IUrlHelper
- 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
參數
- helper
- IUrlHelper
- action
- String
動作方法的名稱。
- values
- Object
包含路由值的物件。
傳回
產生的 URL。
適用於
Action(IUrlHelper, String, String)
產生具有動作方法路徑的 URL,其中包含指定的 action 和 controller 名稱。
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
參數
- helper
- IUrlHelper
- 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
參數
- helper
- IUrlHelper
- action
- String
動作方法的名稱。
- controller
- String
控制器的名稱。
- values
- Object
包含路由值的物件。
傳回
產生的 URL。
適用於
Action(IUrlHelper, String, String, Object, String)
產生具有動作方法路徑的 URL,其中包含指定 action 的名稱、 controller 名稱、路由 values 和 protocol 要使用的 。 如需重要的安全性資訊,請參閱一節。
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
參數
- helper
- IUrlHelper
- 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 名稱、路由 valuesprotocol 和 host 名稱。
如果 protocol 和 host 不是, 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
參數
- helper
- IUrlHelper
- 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 名稱、路由 values 、 fragmentprotocol 要使用的 URL、 host 名稱和 。
如果 protocol 和 host 不是, 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
參數
- helper
- IUrlHelper
- action
- String
動作方法的名稱。
- controller
- String
控制器的名稱。
- values
- Object
包含路由值的物件。
- protocol
- String
URL 的通訊協定,例如 "http" 或 "https"。
- host
- String
URL 的主機名稱。
- fragment
- String
URL 的片段。
傳回
產生的 URL。
備註
的值 host 應該是受信任的值。 除非已驗證標頭,否則 Host 依賴目前要求的值可允許不受信任的輸入影響產生的 URI。 如需如何在部署環境中正確驗證 Host 標頭的指示,請參閱部署檔。