Class FormExtensions
Represents support for HTML in an application.
public static class FormExtensions
- Inheritance
-
FormExtensions
- Inherited Members
Methods
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 MvcForm BeginForm(this HtmlHelper htmlHelper)
Parameters
htmlHelperHtmlHelperThe HTML helper instance that this method extends.
Returns
- MvcForm
An opening <form> tag.
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 MvcForm BeginForm(this HtmlHelper htmlHelper, object routeValues)
Parameters
htmlHelperHtmlHelperThe HTML helper instance that this method extends.
routeValuesobjectAn 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
- MvcForm
An opening <form> tag.
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 MvcForm BeginForm(this HtmlHelper htmlHelper, string actionName, string controllerName)
Parameters
htmlHelperHtmlHelperThe HTML helper instance that this method extends.
actionNamestringThe name of the action method.
controllerNamestringThe name of the controller.
Returns
- MvcForm
An opening <form> tag.
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 MvcForm BeginForm(this HtmlHelper htmlHelper, string actionName, string controllerName, object routeValues)
Parameters
htmlHelperHtmlHelperThe HTML helper instance that this method extends.
actionNamestringThe name of the action method.
controllerNamestringThe name of the controller.
routeValuesobjectAn 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
- MvcForm
An opening <form> tag.
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 MvcForm BeginForm(this HtmlHelper htmlHelper, string actionName, string controllerName, object routeValues, FormMethod method)
Parameters
htmlHelperHtmlHelperThe HTML helper instance that this method extends.
actionNamestringThe name of the action method.
controllerNamestringThe name of the controller.
routeValuesobjectAn 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.
methodFormMethodThe HTTP method for processing the form, either GET or POST.
Returns
- MvcForm
An opening <form> tag.
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 MvcForm BeginForm(this HtmlHelper htmlHelper, string actionName, string controllerName, object routeValues, FormMethod method, object htmlAttributes)
Parameters
htmlHelperHtmlHelperThe HTML helper instance that this method extends.
actionNamestringThe name of the action method.
controllerNamestringThe name of the controller.
routeValuesobjectAn 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.
methodFormMethodThe HTTP method for processing the form, either GET or POST.
htmlAttributesobjectAn object that contains the HTML attributes to set for the element.
Returns
- MvcForm
An opening <form> tag.
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 MvcForm BeginForm(this HtmlHelper htmlHelper, string actionName, string controllerName, FormMethod method)
Parameters
htmlHelperHtmlHelperThe HTML helper instance that this method extends.
actionNamestringThe name of the action method.
controllerNamestringThe name of the controller.
methodFormMethodThe HTTP method for processing the form, either GET or POST.
Returns
- MvcForm
An opening <form> tag.
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 MvcForm BeginForm(this HtmlHelper htmlHelper, string actionName, string controllerName, FormMethod method, IDictionary<string, object> htmlAttributes)
Parameters
htmlHelperHtmlHelperThe HTML helper instance that this method extends.
actionNamestringThe name of the action method.
controllerNamestringThe name of the controller.
methodFormMethodThe HTTP method for processing the form, either GET or POST.
htmlAttributesIDictionary<string, object>An object that contains the HTML attributes to set for the element.
Returns
- MvcForm
An opening <form> tag.
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 MvcForm BeginForm(this HtmlHelper htmlHelper, string actionName, string controllerName, FormMethod method, object htmlAttributes)
Parameters
htmlHelperHtmlHelperThe HTML helper instance that this method extends.
actionNamestringThe name of the action method.
controllerNamestringThe name of the controller.
methodFormMethodThe HTTP method for processing the form, either GET or POST.
htmlAttributesobjectAn object that contains the HTML attributes to set for the element.
Returns
- MvcForm
An opening <form> tag.
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 MvcForm BeginForm(this HtmlHelper htmlHelper, string actionName, string controllerName, RouteValueDictionary routeValues)
Parameters
htmlHelperHtmlHelperThe HTML helper instance that this method extends.
actionNamestringThe name of the action method.
controllerNamestringThe name of the controller.
routeValuesRouteValueDictionaryAn object that contains the parameters for a route.
Returns
- MvcForm
An opening <form> tag.
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 MvcForm BeginForm(this HtmlHelper htmlHelper, string actionName, string controllerName, RouteValueDictionary routeValues, FormMethod method)
Parameters
htmlHelperHtmlHelperThe HTML helper instance that this method extends.
actionNamestringThe name of the action method.
controllerNamestringThe name of the controller.
routeValuesRouteValueDictionaryAn object that contains the parameters for a route.
methodFormMethodThe HTTP method for processing the form, either GET or POST.
Returns
- MvcForm
An opening <form> tag.
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 MvcForm BeginForm(this HtmlHelper htmlHelper, string actionName, string controllerName, RouteValueDictionary routeValues, FormMethod method, IDictionary<string, object> htmlAttributes)
Parameters
htmlHelperHtmlHelperThe HTML helper instance that this method extends.
actionNamestringThe name of the action method.
controllerNamestringThe name of the controller.
routeValuesRouteValueDictionaryAn object that contains the parameters for a route.
methodFormMethodThe HTTP method for processing the form, either GET or POST.
htmlAttributesIDictionary<string, object>An object that contains the HTML attributes to set for the element.
Returns
- MvcForm
An opening <form> tag.
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 MvcForm BeginForm(this HtmlHelper htmlHelper, RouteValueDictionary routeValues)
Parameters
htmlHelperHtmlHelperThe HTML helper instance that this method extends.
routeValuesRouteValueDictionaryAn object that contains the parameters for a route.
Returns
- MvcForm
An opening <form> tag.
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.
public static MvcForm BeginRouteForm(this HtmlHelper htmlHelper, object routeValues)
Parameters
htmlHelperHtmlHelperThe HTML helper instance that this method extends.
routeValuesobjectAn 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
- MvcForm
An opening <form> tag.
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.
public static MvcForm BeginRouteForm(this HtmlHelper htmlHelper, string routeName)
Parameters
htmlHelperHtmlHelperThe HTML helper instance that this method extends.
routeNamestringThe name of the route to use to obtain the form-post URL.
Returns
- MvcForm
An opening <form> tag.
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.
public static MvcForm BeginRouteForm(this HtmlHelper htmlHelper, string routeName, object routeValues)
Parameters
htmlHelperHtmlHelperThe HTML helper instance that this method extends.
routeNamestringThe name of the route to use to obtain the form-post URL.
routeValuesobjectAn 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
- MvcForm
An opening <form> tag.
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.
public static MvcForm BeginRouteForm(this HtmlHelper htmlHelper, string routeName, object routeValues, FormMethod method)
Parameters
htmlHelperHtmlHelperThe HTML helper instance that this method extends.
routeNamestringThe name of the route to use to obtain the form-post URL.
routeValuesobjectAn 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.
methodFormMethodThe HTTP method for processing the form, either GET or POST.
Returns
- MvcForm
An opening <form> tag.
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.
public static MvcForm BeginRouteForm(this HtmlHelper htmlHelper, string routeName, object routeValues, FormMethod method, object htmlAttributes)
Parameters
htmlHelperHtmlHelperThe HTML helper instance that this method extends.
routeNamestringThe name of the route to use to obtain the form-post URL.
routeValuesobjectAn 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.
methodFormMethodThe HTTP method for processing the form, either GET or POST.
htmlAttributesobjectAn object that contains the HTML attributes to set for the element.
Returns
- MvcForm
An opening <form> tag.
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.
public static MvcForm BeginRouteForm(this HtmlHelper htmlHelper, string routeName, FormMethod method)
Parameters
htmlHelperHtmlHelperThe HTML helper instance that this method extends.
routeNamestringThe name of the route to use to obtain the form-post URL.
methodFormMethodThe HTTP method for processing the form, either GET or POST.
Returns
- MvcForm
An opening <form> tag.
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.
public static MvcForm BeginRouteForm(this HtmlHelper htmlHelper, string routeName, FormMethod method, IDictionary<string, object> htmlAttributes)
Parameters
htmlHelperHtmlHelperThe HTML helper instance that this method extends.
routeNamestringThe name of the route to use to obtain the form-post URL.
methodFormMethodThe HTTP method for processing the form, either GET or POST.
htmlAttributesIDictionary<string, object>An object that contains the HTML attributes to set for the element.
Returns
- MvcForm
An opening <form> tag.
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.
public static MvcForm BeginRouteForm(this HtmlHelper htmlHelper, string routeName, FormMethod method, object htmlAttributes)
Parameters
htmlHelperHtmlHelperThe HTML helper instance that this method extends.
routeNamestringThe name of the route to use to obtain the form-post URL.
methodFormMethodThe HTTP method for processing the form, either GET or POST.
htmlAttributesobjectAn object that contains the HTML attributes to set for the element.
Returns
- MvcForm
An opening <form> tag.
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.
public static MvcForm BeginRouteForm(this HtmlHelper htmlHelper, string routeName, RouteValueDictionary routeValues)
Parameters
htmlHelperHtmlHelperThe HTML helper instance that this method extends.
routeNamestringThe name of the route to use to obtain the form-post URL.
routeValuesRouteValueDictionaryAn object that contains the parameters for a route
Returns
- MvcForm
An opening <form> tag.
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.
public static MvcForm BeginRouteForm(this HtmlHelper htmlHelper, string routeName, RouteValueDictionary routeValues, FormMethod method)
Parameters
htmlHelperHtmlHelperThe HTML helper instance that this method extends.
routeNamestringThe name of the route to use to obtain the form-post URL.
routeValuesRouteValueDictionaryAn object that contains the parameters for a route
methodFormMethodThe HTTP method for processing the form, either GET or POST.
Returns
- MvcForm
An opening <form> tag.
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.
public static MvcForm BeginRouteForm(this HtmlHelper htmlHelper, string routeName, RouteValueDictionary routeValues, FormMethod method, IDictionary<string, object> htmlAttributes)
Parameters
htmlHelperHtmlHelperThe HTML helper instance that this method extends.
routeNamestringThe name of the route to use to obtain the form-post URL.
routeValuesRouteValueDictionaryAn object that contains the parameters for a route
methodFormMethodThe HTTP method for processing the form, either GET or POST.
htmlAttributesIDictionary<string, object>An object that contains the HTML attributes to set for the element.
Returns
- MvcForm
An opening <form> tag.
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.
public static MvcForm BeginRouteForm(this HtmlHelper htmlHelper, RouteValueDictionary routeValues)
Parameters
htmlHelperHtmlHelperThe HTML helper instance that this method extends.
routeValuesRouteValueDictionaryAn object that contains the parameters for a route
Returns
- MvcForm
An opening <form> tag.
EndForm(HtmlHelper)
Renders the closing </form> tag to the response.
public static void EndForm(this HtmlHelper htmlHelper)
Parameters
htmlHelperHtmlHelperThe HTML helper instance that this method extends.