name |
Description |
Sample |
Action (String) |
Generates the fully qualified URL of an action method using the specified action name |
@Url. Action ("Action1") |
Action (String, Object) |
Generates the fully qualified URL of an action method using the specified action name and route value |
@Url. Action ("Action1", new {id=1}), note: The second parameter is type object so you can directly new an anonymous object, and note the comparison with the following overloaded methods |
Action (String, String) |
Generates the fully qualified URL of an action method using the specified action name and controller name |
@Url. Action ("Action1", "Controller1") |
Action (String, RouteValueDictionary) |
Generates the fully qualified URL of an action method for the specified action name and route value |
@Url. Action ("Action1", new RouteValueDictionary {{"id", 1}}), note: The second parameter type is routevaluedictionary type so it can't just be a simple new one anonymous object |
Action (String, String, Object) |
Generates the fully qualified URL of an action method using the specified action name, controller name, and route value |
@Url. Action ("Action1", "Controller1", new {id=1}) |
Action (String, String, RouteValueDictionary) |
Generates the fully qualified URL of an action method using the specified action name, controller name, and route value |
@Url. Action ("Action1", "Controller1", new RouteValueDictionary {{"id", 1}}) |
Action (String, String, Object, String) |
The fully qualified URL that generates the action method using the specified action name, controller name, route value, and protocol to use |
@Url. Action ("Action1", "Controller1", new {id=1}, "http or https") |
Action (String, String, RouteValueDictionary, String, String) |
Generates the fully qualified URL of the action method using the specified action name, controller name, route value, protocol to be used, and host name |
@Url. Action ("Action1", "Controller1", new RouteValueDictionary {{"id", 1}}, "http or https", "www.baidu.com"), Note: The last parameter is the host name that is the domain name |