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 的主机部分。 依赖当前请求的值可能会允许不受信任的输入影响生成的 URI, Host
除非标头已经过验证。 有关如何在部署环境中正确验证标头的说明, Host
请参阅部署文档。
适用于
Action(IUrlHelper, String, String, Object, String, String)
生成一个 URL,其中包含操作方法的路径,其中包含指定 action
的名称、 controller
名称、路由 values
、 protocol
要使用的和 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
应为受信任的值。 依赖当前请求的值可能会允许不受信任的输入影响生成的 URI, Host
除非标头已经过验证。 有关如何在部署环境中正确验证标头的说明, Host
请参阅部署文档。
适用于
Action(IUrlHelper, String, String, Object, String, String, String)
生成包含操作方法路径的 URL,其中包含指定的 action
名称、名称、 controller
路由 values
、 protocol
要使用的名称、 host
名称和 fragment
。
如果 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
应为受信任的值。 依赖当前请求的值可能会允许不受信任的输入影响生成的 URI, Host
除非标头已经过验证。 有关如何在部署环境中正确验证标头的说明, Host
请参阅部署文档。
适用于
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈