FormExtensions.BeginForm FormExtensions.BeginForm Method

Definition

Overloads

BeginForm(HtmlHelper) BeginForm(HtmlHelper)

Writes an opening <form> tag to the response. The form uses the POST method, and the request is processed by the action method for the view.

BeginForm(HtmlHelper, String, String, Object, FormMethod, Object) BeginForm(HtmlHelper, String, String, Object, FormMethod, Object)

Writes an opening <form> tag to the response and sets the action tag to the specified controller, action, and route values. The form uses the specified HTTP method and includes the HTML attributes.

BeginForm(HtmlHelper, String, String, RouteValueDictionary, FormMethod) BeginForm(HtmlHelper, String, String, RouteValueDictionary, FormMethod)

Writes an opening <form> tag to the response, and sets the action tag to the specified controller, action, and route values from the route value dictionary. The form uses the specified HTTP method.

BeginForm(HtmlHelper, String, String, FormMethod, Object) BeginForm(HtmlHelper, String, String, FormMethod, Object)

Writes an opening <form> tag to the response and sets the action tag to the specified controller and action. The form uses the specified HTTP method and includes the HTML attributes.

BeginForm(HtmlHelper, String, String, FormMethod, IDictionary<String,Object>) BeginForm(HtmlHelper, String, String, FormMethod, IDictionary<String,Object>)

Writes an opening <form> tag to the response and sets the action tag to the specified controller and action. The form uses the specified HTTP method and includes the HTML attributes from a dictionary.

BeginForm(HtmlHelper, String, String, Object, FormMethod) BeginForm(HtmlHelper, String, String, Object, FormMethod)

Writes an opening <form> tag to the response and sets the action tag to the specified controller, action, and route values. The form uses the specified HTTP method.

BeginForm(HtmlHelper, String, String, RouteValueDictionary, FormMethod, IDictionary<String,Object>) BeginForm(HtmlHelper, String, String, RouteValueDictionary, FormMethod, IDictionary<String,Object>)

Writes an opening <form> tag to the response, and sets the action tag to the specified controller, action, and route values from the route value dictionary. The form uses the specified HTTP method, and includes the HTML attributes from the dictionary.

BeginForm(HtmlHelper, String, String, FormMethod) BeginForm(HtmlHelper, String, String, FormMethod)

Writes an opening <form> tag to the response and sets the action tag to the specified controller and action. The form uses the specified HTTP method.

BeginForm(HtmlHelper, String, String, Object) BeginForm(HtmlHelper, String, String, Object)

Writes an opening <form> tag to the response, and sets the action tag to the specified controller, action, and route values. The form uses the POST method.

BeginForm(HtmlHelper, String, String) BeginForm(HtmlHelper, String, String)

Writes an opening <form> tag to the response and sets the action tag to the specified controller and action. The form uses the POST method.

BeginForm(HtmlHelper, RouteValueDictionary) BeginForm(HtmlHelper, RouteValueDictionary)

Writes an opening <form> tag to the response and includes the route values from the route value dictionary in the action attribute. The form uses the POST method, and the request is processed by the action method for the view.

BeginForm(HtmlHelper, Object) BeginForm(HtmlHelper, Object)

Writes an opening <form> tag to the response and includes the route values in the action attribute. The form uses the POST method, and the request is processed by the action method for the view.

BeginForm(HtmlHelper, String, String, RouteValueDictionary) BeginForm(HtmlHelper, String, String, RouteValueDictionary)

Writes an opening <form> tag to the response, and sets the action tag to the specified controller, action, and route values from the route value dictionary. The form uses the POST method.

BeginForm(HtmlHelper) BeginForm(HtmlHelper)

Writes an opening <form> tag to the response. The form uses the POST method, and the request is processed by the action method for the view.

public static System.Web.Mvc.Html.MvcForm BeginForm (this System.Web.Mvc.HtmlHelper htmlHelper);
static member BeginForm : System.Web.Mvc.HtmlHelper -> System.Web.Mvc.Html.MvcForm
Parameters
htmlHelper
HtmlHelper HtmlHelper

The HTML helper instance that this method extends.

Returns

An opening <form> tag.

BeginForm(HtmlHelper, String, String, Object, FormMethod, Object) BeginForm(HtmlHelper, String, String, Object, FormMethod, Object)

Writes an opening <form> tag to the response and sets the action tag to the specified controller, action, and route values. The form uses the specified HTTP method and includes the HTML attributes.

public static System.Web.Mvc.Html.MvcForm BeginForm (this System.Web.Mvc.HtmlHelper htmlHelper, string actionName, string controllerName, object routeValues, System.Web.Mvc.FormMethod method, object htmlAttributes);
static member BeginForm : System.Web.Mvc.HtmlHelper * string * string * obj * System.Web.Mvc.FormMethod * obj -> System.Web.Mvc.Html.MvcForm
Parameters
htmlHelper
HtmlHelper HtmlHelper

The HTML helper instance that this method extends.

actionName
String String

The name of the action method.

controllerName
String String

The name of the controller.

routeValues
Object Object

An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax.

method
FormMethod FormMethod

The HTTP method for processing the form, either GET or POST.

htmlAttributes
Object Object

An object that contains the HTML attributes to set for the element.

Returns

An opening <form> tag.

BeginForm(HtmlHelper, String, String, RouteValueDictionary, FormMethod) BeginForm(HtmlHelper, String, String, RouteValueDictionary, FormMethod)

Writes an opening <form> tag to the response, and sets the action tag to the specified controller, action, and route values from the route value dictionary. The form uses the specified HTTP method.

public static System.Web.Mvc.Html.MvcForm BeginForm (this System.Web.Mvc.HtmlHelper htmlHelper, string actionName, string controllerName, System.Web.Routing.RouteValueDictionary routeValues, System.Web.Mvc.FormMethod method);
static member BeginForm : System.Web.Mvc.HtmlHelper * string * string * System.Web.Routing.RouteValueDictionary * System.Web.Mvc.FormMethod -> System.Web.Mvc.Html.MvcForm
Parameters
htmlHelper
HtmlHelper HtmlHelper

The HTML helper instance that this method extends.

actionName
String String

The name of the action method.

controllerName
String String

The name of the controller.

routeValues
RouteValueDictionary RouteValueDictionary

An object that contains the parameters for a route.

method
FormMethod FormMethod

The HTTP method for processing the form, either GET or POST.

Returns

An opening <form> tag.

BeginForm(HtmlHelper, String, String, FormMethod, Object) BeginForm(HtmlHelper, String, String, FormMethod, Object)

Writes an opening <form> tag to the response and sets the action tag to the specified controller and action. The form uses the specified HTTP method and includes the HTML attributes.

public static System.Web.Mvc.Html.MvcForm BeginForm (this System.Web.Mvc.HtmlHelper htmlHelper, string actionName, string controllerName, System.Web.Mvc.FormMethod method, object htmlAttributes);
static member BeginForm : System.Web.Mvc.HtmlHelper * string * string * System.Web.Mvc.FormMethod * obj -> System.Web.Mvc.Html.MvcForm
Parameters
htmlHelper
HtmlHelper HtmlHelper

The HTML helper instance that this method extends.

actionName
String String

The name of the action method.

controllerName
String String

The name of the controller.

method
FormMethod FormMethod

The HTTP method for processing the form, either GET or POST.

htmlAttributes
Object Object

An object that contains the HTML attributes to set for the element.

Returns

An opening <form> tag.

BeginForm(HtmlHelper, String, String, FormMethod, IDictionary<String,Object>) BeginForm(HtmlHelper, String, String, FormMethod, IDictionary<String,Object>)

Writes an opening <form> tag to the response and sets the action tag to the specified controller and action. The form uses the specified HTTP method and includes the HTML attributes from a dictionary.

public static System.Web.Mvc.Html.MvcForm BeginForm (this System.Web.Mvc.HtmlHelper htmlHelper, string actionName, string controllerName, System.Web.Mvc.FormMethod method, System.Collections.Generic.IDictionary<string,object> htmlAttributes);
static member BeginForm : System.Web.Mvc.HtmlHelper * string * string * System.Web.Mvc.FormMethod * System.Collections.Generic.IDictionary<string, obj> -> System.Web.Mvc.Html.MvcForm
Parameters
htmlHelper
HtmlHelper HtmlHelper

The HTML helper instance that this method extends.

actionName
String String

The name of the action method.

controllerName
String String

The name of the controller.

method
FormMethod FormMethod

The HTTP method for processing the form, either GET or POST.

htmlAttributes
IDictionary<String,Object>

An object that contains the HTML attributes to set for the element.

Returns

An opening <form> tag.

BeginForm(HtmlHelper, String, String, Object, FormMethod) BeginForm(HtmlHelper, String, String, Object, FormMethod)

Writes an opening <form> tag to the response and sets the action tag to the specified controller, action, and route values. The form uses the specified HTTP method.

public static System.Web.Mvc.Html.MvcForm BeginForm (this System.Web.Mvc.HtmlHelper htmlHelper, string actionName, string controllerName, object routeValues, System.Web.Mvc.FormMethod method);
static member BeginForm : System.Web.Mvc.HtmlHelper * string * string * obj * System.Web.Mvc.FormMethod -> System.Web.Mvc.Html.MvcForm
Parameters
htmlHelper
HtmlHelper HtmlHelper

The HTML helper instance that this method extends.

actionName
String String

The name of the action method.

controllerName
String String

The name of the controller.

routeValues
Object Object

An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax.

method
FormMethod FormMethod

The HTTP method for processing the form, either GET or POST.

Returns

An opening <form> tag.

BeginForm(HtmlHelper, String, String, RouteValueDictionary, FormMethod, IDictionary<String,Object>) BeginForm(HtmlHelper, String, String, RouteValueDictionary, FormMethod, IDictionary<String,Object>)

Writes an opening <form> tag to the response, and sets the action tag to the specified controller, action, and route values from the route value dictionary. The form uses the specified HTTP method, and includes the HTML attributes from the dictionary.

public static System.Web.Mvc.Html.MvcForm BeginForm (this System.Web.Mvc.HtmlHelper htmlHelper, string actionName, string controllerName, System.Web.Routing.RouteValueDictionary routeValues, System.Web.Mvc.FormMethod method, System.Collections.Generic.IDictionary<string,object> htmlAttributes);
static member BeginForm : System.Web.Mvc.HtmlHelper * string * string * System.Web.Routing.RouteValueDictionary * System.Web.Mvc.FormMethod * System.Collections.Generic.IDictionary<string, obj> -> System.Web.Mvc.Html.MvcForm
Parameters
htmlHelper
HtmlHelper HtmlHelper

The HTML helper instance that this method extends.

actionName
String String

The name of the action method.

controllerName
String String

The name of the controller.

routeValues
RouteValueDictionary RouteValueDictionary

An object that contains the parameters for a route.

method
FormMethod FormMethod

The HTTP method for processing the form, either GET or POST.

htmlAttributes
IDictionary<String,Object>

An object that contains the HTML attributes to set for the element.

Returns

An opening <form> tag.

BeginForm(HtmlHelper, String, String, FormMethod) BeginForm(HtmlHelper, String, String, FormMethod)

Writes an opening <form> tag to the response and sets the action tag to the specified controller and action. The form uses the specified HTTP method.

public static System.Web.Mvc.Html.MvcForm BeginForm (this System.Web.Mvc.HtmlHelper htmlHelper, string actionName, string controllerName, System.Web.Mvc.FormMethod method);
static member BeginForm : System.Web.Mvc.HtmlHelper * string * string * System.Web.Mvc.FormMethod -> System.Web.Mvc.Html.MvcForm
Parameters
htmlHelper
HtmlHelper HtmlHelper

The HTML helper instance that this method extends.

actionName
String String

The name of the action method.

controllerName
String String

The name of the controller.

method
FormMethod FormMethod

The HTTP method for processing the form, either GET or POST.

Returns

An opening <form> tag.

BeginForm(HtmlHelper, String, String, Object) BeginForm(HtmlHelper, String, String, Object)

Writes an opening <form> tag to the response, and sets the action tag to the specified controller, action, and route values. The form uses the POST method.

public static System.Web.Mvc.Html.MvcForm BeginForm (this System.Web.Mvc.HtmlHelper htmlHelper, string actionName, string controllerName, object routeValues);
static member BeginForm : System.Web.Mvc.HtmlHelper * string * string * obj -> System.Web.Mvc.Html.MvcForm
Parameters
htmlHelper
HtmlHelper HtmlHelper

The HTML helper instance that this method extends.

actionName
String String

The name of the action method.

controllerName
String String

The name of the controller.

routeValues
Object Object

An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax.

Returns

An opening <form> tag.

BeginForm(HtmlHelper, String, String) BeginForm(HtmlHelper, String, String)

Writes an opening <form> tag to the response and sets the action tag to the specified controller and action. The form uses the POST method.

public static System.Web.Mvc.Html.MvcForm BeginForm (this System.Web.Mvc.HtmlHelper htmlHelper, string actionName, string controllerName);
static member BeginForm : System.Web.Mvc.HtmlHelper * string * string -> System.Web.Mvc.Html.MvcForm
Parameters
htmlHelper
HtmlHelper HtmlHelper

The HTML helper instance that this method extends.

actionName
String String

The name of the action method.

controllerName
String String

The name of the controller.

Returns

An opening <form> tag.

BeginForm(HtmlHelper, RouteValueDictionary) BeginForm(HtmlHelper, RouteValueDictionary)

Writes an opening <form> tag to the response and includes the route values from the route value dictionary in the action attribute. The form uses the POST method, and the request is processed by the action method for the view.

public static System.Web.Mvc.Html.MvcForm BeginForm (this System.Web.Mvc.HtmlHelper htmlHelper, System.Web.Routing.RouteValueDictionary routeValues);
static member BeginForm : System.Web.Mvc.HtmlHelper * System.Web.Routing.RouteValueDictionary -> System.Web.Mvc.Html.MvcForm
Parameters
htmlHelper
HtmlHelper HtmlHelper

The HTML helper instance that this method extends.

routeValues
RouteValueDictionary RouteValueDictionary

An object that contains the parameters for a route.

Returns

An opening <form> tag.

BeginForm(HtmlHelper, Object) BeginForm(HtmlHelper, Object)

Writes an opening <form> tag to the response and includes the route values in the action attribute. The form uses the POST method, and the request is processed by the action method for the view.

public static System.Web.Mvc.Html.MvcForm BeginForm (this System.Web.Mvc.HtmlHelper htmlHelper, object routeValues);
static member BeginForm : System.Web.Mvc.HtmlHelper * obj -> System.Web.Mvc.Html.MvcForm
Parameters
htmlHelper
HtmlHelper HtmlHelper

The HTML helper instance that this method extends.

routeValues
Object Object

An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax.

Returns

An opening <form> tag.

BeginForm(HtmlHelper, String, String, RouteValueDictionary) BeginForm(HtmlHelper, String, String, RouteValueDictionary)

Writes an opening <form> tag to the response, and sets the action tag to the specified controller, action, and route values from the route value dictionary. The form uses the POST method.

public static System.Web.Mvc.Html.MvcForm BeginForm (this System.Web.Mvc.HtmlHelper htmlHelper, string actionName, string controllerName, System.Web.Routing.RouteValueDictionary routeValues);
static member BeginForm : System.Web.Mvc.HtmlHelper * string * string * System.Web.Routing.RouteValueDictionary -> System.Web.Mvc.Html.MvcForm
Parameters
htmlHelper
HtmlHelper HtmlHelper

The HTML helper instance that this method extends.

actionName
String String

The name of the action method.

controllerName
String String

The name of the controller.

routeValues
RouteValueDictionary RouteValueDictionary

An object that contains the parameters for a route.

Returns

An opening <form> tag.

Applies to