Export (0) Print
Expand All

FormExtensions.BeginForm Method

Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by 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.

  Name Description
Public method Static member 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 method Static member 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 method Static member 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 method Static member 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 method Static member 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 method Static member 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 method Static member 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 method Static member 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 method Static member 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 method Static member 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 method Static member 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 method Static member 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 method Static member 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.
Top

The BeginForm method renders a form that will be handled by a controller action method.

You can use this method in a using statement. In that case, the method renders the closing </form> tag at the end of the using block.

Show:
© 2014 Microsoft