FormExtensions Class
Represents support for HTML in an application.
Namespace: System.Web.Mvc.Html
Assembly: System.Web.Mvc (in System.Web.Mvc.dll)
The FormExtensions type exposes the following members.
| Name | Description | |
|---|---|---|
![]() ![]() | BeginForm(HtmlHelper) | Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by an action method. |
![]() ![]() | BeginForm(HtmlHelper, Object) | Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by an action method. |
![]() ![]() | BeginForm(HtmlHelper, RouteValueDictionary) | Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by an action method. |
![]() ![]() | BeginForm(HtmlHelper, String, String) | Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by an action method. |
![]() ![]() | BeginForm(HtmlHelper, String, String, Object) | Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by an action method. |
![]() ![]() | BeginForm(HtmlHelper, String, String, FormMethod) | Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by an action method. |
![]() ![]() | BeginForm(HtmlHelper, String, String, RouteValueDictionary) | Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by an action method. |
![]() ![]() | BeginForm(HtmlHelper, String, String, Object, FormMethod) | Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by an action method. |
![]() ![]() | BeginForm(HtmlHelper, String, String, FormMethod, IDictionary<String, Object>) | Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by an action method. |
![]() ![]() | BeginForm(HtmlHelper, String, String, FormMethod, Object) | Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by an action method. |
![]() ![]() | BeginForm(HtmlHelper, String, String, RouteValueDictionary, FormMethod) | Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by an action method. |
![]() ![]() | BeginForm(HtmlHelper, String, String, Object, FormMethod, Object) | Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by an action method. |
![]() ![]() | BeginForm(HtmlHelper, String, String, RouteValueDictionary, FormMethod, IDictionary<String, Object>) | Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by an action method. |
![]() ![]() | BeginRouteForm(HtmlHelper, Object) | Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. |
![]() ![]() | BeginRouteForm(HtmlHelper, String) | Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. |
![]() ![]() | BeginRouteForm(HtmlHelper, RouteValueDictionary) | Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. |
![]() ![]() | BeginRouteForm(HtmlHelper, String, Object) | Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. |
![]() ![]() | BeginRouteForm(HtmlHelper, String, FormMethod) | Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. |
![]() ![]() | BeginRouteForm(HtmlHelper, String, RouteValueDictionary) | Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. |
![]() ![]() | BeginRouteForm(HtmlHelper, String, Object, FormMethod) | Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. |
![]() ![]() | BeginRouteForm(HtmlHelper, String, FormMethod, IDictionary<String, Object>) | Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. |
![]() ![]() | BeginRouteForm(HtmlHelper, String, FormMethod, Object) | Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. |
![]() ![]() | BeginRouteForm(HtmlHelper, String, RouteValueDictionary, FormMethod) | Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. |
![]() ![]() | BeginRouteForm(HtmlHelper, String, Object, FormMethod, Object) | Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. |
![]() ![]() | BeginRouteForm(HtmlHelper, String, RouteValueDictionary, FormMethod, IDictionary<String, Object>) | Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. |
![]() ![]() | EndForm | Renders the closing </form> tag to the response. |
The FormExtensions class contains methods that extend the HtmlHelper class. Each extension method renders an HTML form element. The BeginForm method renders a form that will be handled by a controller action method. The BeginRouteForm method renders a form that will be handled by the URL that is identified by specified route parameters. The EndForm method renders the closing element for a form.
This example shows two ways to create the same form in ASP.NET MVC. The first way uses the Using statement. The second way uses the MvcForm class directly.
Show:
