Udostępnij za pośrednictwem


UrlHelper.Action Method

Include Protected Members
Include Inherited Members

Generates a fully qualified URL to an action method.

This member is overloaded. For complete information about this member, including syntax, usage, and examples, click a name in the overload list.

Overload List

  Name Description
Public method Action(String) Generates a fully qualified URL to an action method by using the specified action name.
Public method Action(String, Object) Generates a fully qualified URL to an action method by using the specified action name and route values.
Public method Action(String, String) Generates a fully qualified URL to an action method by using the specified action name and controller name.
Public method Action(String, RouteValueDictionary) Generates a fully qualified URL to an action method for the specified action name and route values.
Public method Action(String, String, Object) Generates a fully qualified URL to an action method by using the specified action name, controller name, and route values.
Public method Action(String, String, RouteValueDictionary) Generates a fully qualified URL to an action method by using the specified action name, controller name, and route values.
Public method Action(String, String, Object, String) Generates a fully qualified URL to an action method by using the specified action name, controller name, route values, and protocol to use.
Public method Action(String, String, RouteValueDictionary, String, String) Generates a fully qualified URL for an action method by using the specified action name, controller name, route values, protocol to use, and host name.

Top

Remarks

The URL that is returned by this method has a format like the following:

\Home\About

If special characters in the URL must be encoded, use the Encode method. For the previous example, the Encode method returns the following URL:

%2fHome%2fAbout

See Also

Reference

UrlHelper Class

System.Web.Mvc Namespace