Export (0) Print
Expand All

ChildActionExtensions Class

Represents support for calling child action methods and rendering the result inline in a parent view.

System.Object
  System.Web.Mvc.Html.ChildActionExtensions

Namespace:  System.Web.Mvc.Html
Assembly:  System.Web.Mvc (in System.Web.Mvc.dll)

public static class ChildActionExtensions

  NameDescription
Public methodStatic memberAction(HtmlHelper, String)Invokes the specified child action method and returns the result as an HTML string.
Public methodStatic memberAction(HtmlHelper, String, Object)Invokes the specified child action method with the specified parameters and returns the result as an HTML string.
Public methodStatic memberAction(HtmlHelper, String, String)Invokes the specified child action method using the specified controller name and returns the result as an HTML string.
Public methodStatic memberAction(HtmlHelper, String, RouteValueDictionary)Invokes the specified child action method using the specified parameters and returns the result as an HTML string.
Public methodStatic memberAction(HtmlHelper, String, String, Object)Invokes the specified child action method using the specified parameters and controller name and returns the result as an HTML string.
Public methodStatic memberAction(HtmlHelper, String, String, RouteValueDictionary)Invokes the specified child action method using the specified parameters and controller name and returns the result as an HTML string.
Public methodStatic memberRenderAction(HtmlHelper, String)Invokes the specified child action method and renders the result inline in the parent view.
Public methodStatic memberRenderAction(HtmlHelper, String, Object)Invokes the specified child action method using the specified parameters and renders the result inline in the parent view.
Public methodStatic memberRenderAction(HtmlHelper, String, String)Invokes the specified child action method using the specified controller name and renders the result inline in the parent view.
Public methodStatic memberRenderAction(HtmlHelper, String, RouteValueDictionary)Invokes the specified child action method using the specified parameters and renders the result inline in the parent view.
Public methodStatic memberRenderAction(HtmlHelper, String, String, Object)Invokes the specified child action method using the specified parameters and controller name and renders the result inline in the parent view.
Public methodStatic memberRenderAction(HtmlHelper, String, String, RouteValueDictionary)Invokes the specified child action method using the specified parameters and controller name and renders the result inline in the parent view.
Top

A child action method renders part of a view instead of the whole view. To call a child action, use either the Action method, which returns an HTML string, or the RenderAction method, which renders the action results inline.

A call to Action or RenderAction uses the existing HTTP context, so the request data is relative to the original request (including the raw URL of the request). This means that from the rendered action you can bind to data from the original request (including form values, query string values, route values, and so on). This also means that all relative URLs that are returned by the child action's view will be relative to the parent (root) action. The HTTP method of the request will be the method of the parent (root) request.

The HandleErrorAttribute attribute on a child action method is ignored if an exception occurs in the child action itself. Therefore, a child action should handle its own exceptions. If a child action has an AuthorizeAttribute attribute applied, the attribute will execute and return an HTTP Unauthorized 401 status code.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft