Table of Contents

Class ChildActionExtensions

Namespace
System.Web.Mvc.Html
Assembly
System.Web.Mvc.dll

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

public static class ChildActionExtensions
Inheritance
ChildActionExtensions
Inherited Members

Methods

Action(HtmlHelper, string)

Invokes the specified child action method and returns the result as an HTML string.

public static MvcHtmlString Action(this HtmlHelper htmlHelper, string actionName)

Parameters

htmlHelper HtmlHelper

The HTML helper instance that this method extends.

actionName string

The name of the action method to invoke.

Returns

MvcHtmlString

The child action result as an HTML string.

Exceptions

ArgumentNullException

The htmlHelper parameter is null.

ArgumentException

The actionName parameter is null or empty.

InvalidOperationException

The required virtual path data cannot be found.

Action(HtmlHelper, string, object)

Invokes the specified child action method with the specified parameters and returns the result as an HTML string.

public static MvcHtmlString Action(this HtmlHelper htmlHelper, string actionName, object routeValues)

Parameters

htmlHelper HtmlHelper

The HTML helper instance that this method extends.

actionName string

The name of the action method to invoke.

routeValues object

An object that contains the parameters for a route. You can use routeValues to provide the parameters that are bound to the action method parameters. The routeValues parameter is merged with the original route values and overrides them.

Returns

MvcHtmlString

The child action result as an HTML string.

Exceptions

ArgumentNullException

The htmlHelper parameter is null.

ArgumentException

The actionName parameter is null or empty.

InvalidOperationException

The required virtual path data cannot be found.

Action(HtmlHelper, string, string)

Invokes the specified child action method using the specified controller name and returns the result as an HTML string.

public static MvcHtmlString Action(this HtmlHelper htmlHelper, string actionName, string controllerName)

Parameters

htmlHelper HtmlHelper

The HTML helper instance that this method extends.

actionName string

The name of the action method to invoke.

controllerName string

The name of the controller that contains the action method.

Returns

MvcHtmlString

The child action result as an HTML string.

Exceptions

ArgumentNullException

The htmlHelper parameter is null.

ArgumentException

The actionName parameter is null or empty.

InvalidOperationException

The required virtual path data cannot be found.

Action(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 static MvcHtmlString Action(this HtmlHelper htmlHelper, string actionName, string controllerName, object routeValues)

Parameters

htmlHelper HtmlHelper

The HTML helper instance that this method extends.

actionName string

The name of the action method to invoke.

controllerName string

The name of the controller that contains the action method.

routeValues object

An object that contains the parameters for a route. You can use routeValues to provide the parameters that are bound to the action method parameters. The routeValues parameter is merged with the original route values and overrides them.

Returns

MvcHtmlString

The child action result as an HTML string.

Exceptions

ArgumentNullException

The htmlHelper parameter is null.

ArgumentException

The actionName parameter is null or empty.

InvalidOperationException

The required virtual path data cannot be found.

Action(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 static MvcHtmlString Action(this HtmlHelper htmlHelper, string actionName, string controllerName, RouteValueDictionary routeValues)

Parameters

htmlHelper HtmlHelper

The HTML helper instance that this method extends.

actionName string

The name of the action method to invoke.

controllerName string

The name of the controller that contains the action method.

routeValues RouteValueDictionary

A dictionary that contains the parameters for a route. You can use routeValues to provide the parameters that are bound to the action method parameters. The routeValues parameter is merged with the original route values and overrides them.

Returns

MvcHtmlString

The child action result as an HTML string.

Exceptions

ArgumentNullException

The htmlHelper parameter is null.

ArgumentException

The actionName parameter is null or empty.

InvalidOperationException

The required virtual path data cannot be found.

Action(HtmlHelper, string, RouteValueDictionary)

Invokes the specified child action method using the specified parameters and returns the result as an HTML string.

public static MvcHtmlString Action(this HtmlHelper htmlHelper, string actionName, RouteValueDictionary routeValues)

Parameters

htmlHelper HtmlHelper

The HTML helper instance that this method extends.

actionName string

The name of the action method to invoke.

routeValues RouteValueDictionary

A dictionary that contains the parameters for a route. You can use routeValues to provide the parameters that are bound to the action method parameters. The routeValues parameter is merged with the original route values and overrides them.

Returns

MvcHtmlString

The child action result as an HTML string.

Exceptions

ArgumentNullException

The htmlHelper parameter is null.

ArgumentException

The actionName parameter is null or empty.

InvalidOperationException

The required virtual path data cannot be found.

RenderAction(HtmlHelper, string)

Invokes the specified child action method and renders the result inline in the parent view.

public static void RenderAction(this HtmlHelper htmlHelper, string actionName)

Parameters

htmlHelper HtmlHelper

The HTML helper instance that this method extends.

actionName string

The name of the child action method to invoke.

Exceptions

ArgumentNullException

The htmlHelper parameter is null.

ArgumentException

The actionName parameter is null or empty.

InvalidOperationException

The required virtual path data cannot be found.

RenderAction(HtmlHelper, string, object)

Invokes the specified child action method using the specified parameters and renders the result inline in the parent view.

public static void RenderAction(this HtmlHelper htmlHelper, string actionName, object routeValues)

Parameters

htmlHelper HtmlHelper

The HTML helper instance that this method extends.

actionName string

The name of the child action method to invoke.

routeValues object

An object that contains the parameters for a route. You can use routeValues to provide the parameters that are bound to the action method parameters. The routeValues parameter is merged with the original route values and overrides them.

Exceptions

ArgumentNullException

The htmlHelper parameter is null.

ArgumentException

The actionName parameter is null or empty.

InvalidOperationException

The required virtual path data cannot be found.

RenderAction(HtmlHelper, string, string)

Invokes the specified child action method using the specified controller name and renders the result inline in the parent view.

public static void RenderAction(this HtmlHelper htmlHelper, string actionName, string controllerName)

Parameters

htmlHelper HtmlHelper

The HTML helper instance that this method extends.

actionName string

The name of the child action method to invoke.

controllerName string

The name of the controller that contains the action method.

Exceptions

ArgumentNullException

The htmlHelper parameter is null.

ArgumentException

The actionName parameter is null or empty.

InvalidOperationException

The required virtual path data cannot be found.

RenderAction(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 static void RenderAction(this HtmlHelper htmlHelper, string actionName, string controllerName, object routeValues)

Parameters

htmlHelper HtmlHelper

The HTML helper instance that this method extends.

actionName string

The name of the child action method to invoke.

controllerName string

The name of the controller that contains the action method.

routeValues object

An object that contains the parameters for a route. You can use routeValues to provide the parameters that are bound to the action method parameters. The routeValues parameter is merged with the original route values and overrides them.

Exceptions

ArgumentNullException

The htmlHelper parameter is null.

ArgumentException

The actionName parameter is null or empty.

InvalidOperationException

The required virtual path data cannot be found.

RenderAction(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.

public static void RenderAction(this HtmlHelper htmlHelper, string actionName, string controllerName, RouteValueDictionary routeValues)

Parameters

htmlHelper HtmlHelper

The HTML helper instance that this method extends.

actionName string

The name of the child action method to invoke.

controllerName string

The name of the controller that contains the action method.

routeValues RouteValueDictionary

A dictionary that contains the parameters for a route. You can use routeValues to provide the parameters that are bound to the action method parameters. The routeValues parameter is merged with the original route values and overrides them.

Exceptions

ArgumentNullException

The htmlHelper parameter is null.

ArgumentException

The actionName parameter is null or empty.

InvalidOperationException

The required virtual path data cannot be found.

RenderAction(HtmlHelper, string, RouteValueDictionary)

Invokes the specified child action method using the specified parameters and renders the result inline in the parent view.

public static void RenderAction(this HtmlHelper htmlHelper, string actionName, RouteValueDictionary routeValues)

Parameters

htmlHelper HtmlHelper

The HTML helper instance that this method extends.

actionName string

The name of the child action method to invoke.

routeValues RouteValueDictionary

A dictionary that contains the parameters for a route. You can use routeValues to provide the parameters that are bound to the action method parameters. The routeValues parameter is merged with the original route values and overrides them.

Exceptions

ArgumentNullException

The htmlHelper parameter is null.

ArgumentException

The actionName parameter is null or empty.

InvalidOperationException

The required virtual path data cannot be found.