Share via


HtmlHelperFormExtensions.BeginForm Method

Definition

Overloads

BeginForm(IHtmlHelper)

Renders a <form> start tag to the response. The <form>'s action attribute value will match the current request.

BeginForm(IHtmlHelper, String, String, Object, FormMethod)

Renders a <form> start tag to the response. When the user submits the form, the action with name actionName will process the request.

BeginForm(IHtmlHelper, String, String, Object)

Renders a <form> start tag to the response. When the user submits the form, the action with name actionName will process the request.

BeginForm(IHtmlHelper, String, String, FormMethod)

Renders a <form> start tag to the response. When the user submits the form, the action with name actionName will process the request.

BeginForm(IHtmlHelper, FormMethod, Nullable<Boolean>, Object)

Renders a <form> start tag to the response. When the user submits the form, the current action will process the request.

BeginForm(IHtmlHelper, String, String, FormMethod, Object)

Renders a <form> start tag to the response. When the user submits the form, the action with name actionName will process the request.

BeginForm(IHtmlHelper, FormMethod, Object)

Renders a <form> start tag to the response. When the user submits the form, the current action will process the request.

BeginForm(IHtmlHelper, Object)

Renders a <form> start tag to the response. When the user submits the form, the current action will process the request.

BeginForm(IHtmlHelper, Nullable<Boolean>)

Renders a <form> start tag to the response. The <form>'s action attribute value will match the current request.

BeginForm(IHtmlHelper, FormMethod)

Renders a <form> start tag to the response. When the user submits the form, the current action will process the request.

BeginForm(IHtmlHelper, String, String)

Renders a <form> start tag to the response. When the user submits the form, the action with name actionName will process the request.

BeginForm(IHtmlHelper)

Source:
HtmlHelperFormExtensions.cs
Source:
HtmlHelperFormExtensions.cs
Source:
HtmlHelperFormExtensions.cs

Renders a <form> start tag to the response. The <form>'s action attribute value will match the current request.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Mvc::Rendering::MvcForm ^ BeginForm(Microsoft::AspNetCore::Mvc::Rendering::IHtmlHelper ^ htmlHelper);
public static Microsoft.AspNetCore.Mvc.Rendering.MvcForm BeginForm (this Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper htmlHelper);
static member BeginForm : Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper -> Microsoft.AspNetCore.Mvc.Rendering.MvcForm
<Extension()>
Public Function BeginForm (htmlHelper As IHtmlHelper) As MvcForm

Parameters

htmlHelper
IHtmlHelper

The IHtmlHelper instance this method extends.

Returns

An MvcForm instance which renders the </form> end tag when disposed.

Remarks

In this context, "renders" means the method writes its output using Writer.

Applies to

BeginForm(IHtmlHelper, String, String, Object, FormMethod)

Source:
HtmlHelperFormExtensions.cs
Source:
HtmlHelperFormExtensions.cs
Source:
HtmlHelperFormExtensions.cs

Renders a <form> start tag to the response. When the user submits the form, the action with name actionName will process the request.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Mvc::Rendering::MvcForm ^ BeginForm(Microsoft::AspNetCore::Mvc::Rendering::IHtmlHelper ^ htmlHelper, System::String ^ actionName, System::String ^ controllerName, System::Object ^ routeValues, Microsoft::AspNetCore::Mvc::Rendering::FormMethod method);
public static Microsoft.AspNetCore.Mvc.Rendering.MvcForm BeginForm (this Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper htmlHelper, string actionName, string controllerName, object routeValues, Microsoft.AspNetCore.Mvc.Rendering.FormMethod method);
static member BeginForm : Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper * string * string * obj * Microsoft.AspNetCore.Mvc.Rendering.FormMethod -> Microsoft.AspNetCore.Mvc.Rendering.MvcForm
<Extension()>
Public Function BeginForm (htmlHelper As IHtmlHelper, actionName As String, controllerName As String, routeValues As Object, method As FormMethod) As MvcForm

Parameters

htmlHelper
IHtmlHelper

The IHtmlHelper instance this method extends.

actionName
String

The name of the action method.

controllerName
String

The name of the controller.

routeValues
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 using Object initializer syntax. Alternatively, an IDictionary<TKey,TValue> instance containing the route parameters.

method
FormMethod

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

Returns

An MvcForm instance which renders the </form> end tag when disposed.

Remarks

In this context, "renders" means the method writes its output using Writer.

Applies to

BeginForm(IHtmlHelper, String, String, Object)

Source:
HtmlHelperFormExtensions.cs
Source:
HtmlHelperFormExtensions.cs
Source:
HtmlHelperFormExtensions.cs

Renders a <form> start tag to the response. When the user submits the form, the action with name actionName will process the request.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Mvc::Rendering::MvcForm ^ BeginForm(Microsoft::AspNetCore::Mvc::Rendering::IHtmlHelper ^ htmlHelper, System::String ^ actionName, System::String ^ controllerName, System::Object ^ routeValues);
public static Microsoft.AspNetCore.Mvc.Rendering.MvcForm BeginForm (this Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper htmlHelper, string actionName, string controllerName, object routeValues);
static member BeginForm : Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper * string * string * obj -> Microsoft.AspNetCore.Mvc.Rendering.MvcForm
<Extension()>
Public Function BeginForm (htmlHelper As IHtmlHelper, actionName As String, controllerName As String, routeValues As Object) As MvcForm

Parameters

htmlHelper
IHtmlHelper

The IHtmlHelper instance this method extends.

actionName
String

The name of the action method.

controllerName
String

The name of the controller.

routeValues
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 using Object initializer syntax. Alternatively, an IDictionary<TKey,TValue> instance containing the route parameters.

Returns

An MvcForm instance which renders the </form> end tag when disposed.

Remarks

In this context, "renders" means the method writes its output using Writer.

Applies to

BeginForm(IHtmlHelper, String, String, FormMethod)

Source:
HtmlHelperFormExtensions.cs
Source:
HtmlHelperFormExtensions.cs
Source:
HtmlHelperFormExtensions.cs

Renders a <form> start tag to the response. When the user submits the form, the action with name actionName will process the request.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Mvc::Rendering::MvcForm ^ BeginForm(Microsoft::AspNetCore::Mvc::Rendering::IHtmlHelper ^ htmlHelper, System::String ^ actionName, System::String ^ controllerName, Microsoft::AspNetCore::Mvc::Rendering::FormMethod method);
public static Microsoft.AspNetCore.Mvc.Rendering.MvcForm BeginForm (this Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper htmlHelper, string actionName, string controllerName, Microsoft.AspNetCore.Mvc.Rendering.FormMethod method);
static member BeginForm : Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper * string * string * Microsoft.AspNetCore.Mvc.Rendering.FormMethod -> Microsoft.AspNetCore.Mvc.Rendering.MvcForm
<Extension()>
Public Function BeginForm (htmlHelper As IHtmlHelper, actionName As String, controllerName As String, method As FormMethod) As MvcForm

Parameters

htmlHelper
IHtmlHelper

The IHtmlHelper instance this method extends.

actionName
String

The name of the action method.

controllerName
String

The name of the controller.

method
FormMethod

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

Returns

An MvcForm instance which renders the </form> end tag when disposed.

Remarks

In this context, "renders" means the method writes its output using Writer.

Applies to

BeginForm(IHtmlHelper, FormMethod, Nullable<Boolean>, Object)

Source:
HtmlHelperFormExtensions.cs
Source:
HtmlHelperFormExtensions.cs
Source:
HtmlHelperFormExtensions.cs

Renders a <form> start tag to the response. When the user submits the form, the current action will process the request.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Mvc::Rendering::MvcForm ^ BeginForm(Microsoft::AspNetCore::Mvc::Rendering::IHtmlHelper ^ htmlHelper, Microsoft::AspNetCore::Mvc::Rendering::FormMethod method, Nullable<bool> antiforgery, System::Object ^ htmlAttributes);
public static Microsoft.AspNetCore.Mvc.Rendering.MvcForm BeginForm (this Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper htmlHelper, Microsoft.AspNetCore.Mvc.Rendering.FormMethod method, bool? antiforgery, object htmlAttributes);
static member BeginForm : Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper * Microsoft.AspNetCore.Mvc.Rendering.FormMethod * Nullable<bool> * obj -> Microsoft.AspNetCore.Mvc.Rendering.MvcForm
<Extension()>
Public Function BeginForm (htmlHelper As IHtmlHelper, method As FormMethod, antiforgery As Nullable(Of Boolean), htmlAttributes As Object) As MvcForm

Parameters

htmlHelper
IHtmlHelper

The IHtmlHelper instance this method extends.

method
FormMethod

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

antiforgery
Nullable<Boolean>

If true, <form> elements will include an antiforgery token. If false, suppresses the generation an <input> of type "hidden" with an antiforgery token. If null, <form> elements will include an antiforgery token only if method is not Get.

htmlAttributes
Object

An Object that contains the HTML attributes for the element. Alternatively, an IDictionary<TKey,TValue> instance containing the HTML attributes.

Returns

An MvcForm instance which renders the </form> end tag when disposed.

Remarks

In this context, "renders" means the method writes its output using Writer.

Applies to

BeginForm(IHtmlHelper, String, String, FormMethod, Object)

Source:
HtmlHelperFormExtensions.cs
Source:
HtmlHelperFormExtensions.cs
Source:
HtmlHelperFormExtensions.cs

Renders a <form> start tag to the response. When the user submits the form, the action with name actionName will process the request.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Mvc::Rendering::MvcForm ^ BeginForm(Microsoft::AspNetCore::Mvc::Rendering::IHtmlHelper ^ htmlHelper, System::String ^ actionName, System::String ^ controllerName, Microsoft::AspNetCore::Mvc::Rendering::FormMethod method, System::Object ^ htmlAttributes);
public static Microsoft.AspNetCore.Mvc.Rendering.MvcForm BeginForm (this Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper htmlHelper, string actionName, string controllerName, Microsoft.AspNetCore.Mvc.Rendering.FormMethod method, object htmlAttributes);
static member BeginForm : Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper * string * string * Microsoft.AspNetCore.Mvc.Rendering.FormMethod * obj -> Microsoft.AspNetCore.Mvc.Rendering.MvcForm
<Extension()>
Public Function BeginForm (htmlHelper As IHtmlHelper, actionName As String, controllerName As String, method As FormMethod, htmlAttributes As Object) As MvcForm

Parameters

htmlHelper
IHtmlHelper

The IHtmlHelper instance this method extends.

actionName
String

The name of the action method.

controllerName
String

The name of the controller.

method
FormMethod

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

htmlAttributes
Object

An Object that contains the HTML attributes for the element. Alternatively, an IDictionary<TKey,TValue> instance containing the HTML attributes.

Returns

An MvcForm instance which renders the </form> end tag when disposed.

Remarks

In this context, "renders" means the method writes its output using Writer.

Applies to

BeginForm(IHtmlHelper, FormMethod, Object)

Source:
HtmlHelperFormExtensions.cs
Source:
HtmlHelperFormExtensions.cs
Source:
HtmlHelperFormExtensions.cs

Renders a <form> start tag to the response. When the user submits the form, the current action will process the request.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Mvc::Rendering::MvcForm ^ BeginForm(Microsoft::AspNetCore::Mvc::Rendering::IHtmlHelper ^ htmlHelper, Microsoft::AspNetCore::Mvc::Rendering::FormMethod method, System::Object ^ htmlAttributes);
public static Microsoft.AspNetCore.Mvc.Rendering.MvcForm BeginForm (this Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper htmlHelper, Microsoft.AspNetCore.Mvc.Rendering.FormMethod method, object htmlAttributes);
static member BeginForm : Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper * Microsoft.AspNetCore.Mvc.Rendering.FormMethod * obj -> Microsoft.AspNetCore.Mvc.Rendering.MvcForm
<Extension()>
Public Function BeginForm (htmlHelper As IHtmlHelper, method As FormMethod, htmlAttributes As Object) As MvcForm

Parameters

htmlHelper
IHtmlHelper

The IHtmlHelper instance this method extends.

method
FormMethod

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

htmlAttributes
Object

An Object that contains the HTML attributes for the element. Alternatively, an IDictionary<TKey,TValue> instance containing the HTML attributes.

Returns

An MvcForm instance which renders the </form> end tag when disposed.

Remarks

In this context, "renders" means the method writes its output using Writer.

Applies to

BeginForm(IHtmlHelper, Object)

Source:
HtmlHelperFormExtensions.cs
Source:
HtmlHelperFormExtensions.cs
Source:
HtmlHelperFormExtensions.cs

Renders a <form> start tag to the response. When the user submits the form, the current action will process the request.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Mvc::Rendering::MvcForm ^ BeginForm(Microsoft::AspNetCore::Mvc::Rendering::IHtmlHelper ^ htmlHelper, System::Object ^ routeValues);
public static Microsoft.AspNetCore.Mvc.Rendering.MvcForm BeginForm (this Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper htmlHelper, object routeValues);
static member BeginForm : Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper * obj -> Microsoft.AspNetCore.Mvc.Rendering.MvcForm
<Extension()>
Public Function BeginForm (htmlHelper As IHtmlHelper, routeValues As Object) As MvcForm

Parameters

htmlHelper
IHtmlHelper

The IHtmlHelper instance this method extends.

routeValues
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 using Object initializer syntax. Alternatively, an IDictionary<TKey,TValue> instance containing the route parameters.

Returns

An MvcForm instance which renders the </form> end tag when disposed.

Remarks

In this context, "renders" means the method writes its output using Writer.

Applies to

BeginForm(IHtmlHelper, Nullable<Boolean>)

Source:
HtmlHelperFormExtensions.cs
Source:
HtmlHelperFormExtensions.cs
Source:
HtmlHelperFormExtensions.cs

Renders a <form> start tag to the response. The <form>'s action attribute value will match the current request.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Mvc::Rendering::MvcForm ^ BeginForm(Microsoft::AspNetCore::Mvc::Rendering::IHtmlHelper ^ htmlHelper, Nullable<bool> antiforgery);
public static Microsoft.AspNetCore.Mvc.Rendering.MvcForm BeginForm (this Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper htmlHelper, bool? antiforgery);
static member BeginForm : Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper * Nullable<bool> -> Microsoft.AspNetCore.Mvc.Rendering.MvcForm
<Extension()>
Public Function BeginForm (htmlHelper As IHtmlHelper, antiforgery As Nullable(Of Boolean)) As MvcForm

Parameters

htmlHelper
IHtmlHelper

The IHtmlHelper instance this method extends.

antiforgery
Nullable<Boolean>

If true, <form> elements will include an antiforgery token. If false, suppresses the generation an <input> of type "hidden" with an antiforgery token. If null, <form> elements will include an antiforgery token.

Returns

An MvcForm instance which renders the </form> end tag when disposed.

Remarks

In this context, "renders" means the method writes its output using Writer.

Applies to

BeginForm(IHtmlHelper, FormMethod)

Source:
HtmlHelperFormExtensions.cs
Source:
HtmlHelperFormExtensions.cs
Source:
HtmlHelperFormExtensions.cs

Renders a <form> start tag to the response. When the user submits the form, the current action will process the request.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Mvc::Rendering::MvcForm ^ BeginForm(Microsoft::AspNetCore::Mvc::Rendering::IHtmlHelper ^ htmlHelper, Microsoft::AspNetCore::Mvc::Rendering::FormMethod method);
public static Microsoft.AspNetCore.Mvc.Rendering.MvcForm BeginForm (this Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper htmlHelper, Microsoft.AspNetCore.Mvc.Rendering.FormMethod method);
static member BeginForm : Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper * Microsoft.AspNetCore.Mvc.Rendering.FormMethod -> Microsoft.AspNetCore.Mvc.Rendering.MvcForm
<Extension()>
Public Function BeginForm (htmlHelper As IHtmlHelper, method As FormMethod) As MvcForm

Parameters

htmlHelper
IHtmlHelper

The IHtmlHelper instance this method extends.

method
FormMethod

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

Returns

An MvcForm instance which renders the </form> end tag when disposed.

Remarks

In this context, "renders" means the method writes its output using Writer.

Applies to

BeginForm(IHtmlHelper, String, String)

Source:
HtmlHelperFormExtensions.cs
Source:
HtmlHelperFormExtensions.cs
Source:
HtmlHelperFormExtensions.cs

Renders a <form> start tag to the response. When the user submits the form, the action with name actionName will process the request.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Mvc::Rendering::MvcForm ^ BeginForm(Microsoft::AspNetCore::Mvc::Rendering::IHtmlHelper ^ htmlHelper, System::String ^ actionName, System::String ^ controllerName);
public static Microsoft.AspNetCore.Mvc.Rendering.MvcForm BeginForm (this Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper htmlHelper, string actionName, string controllerName);
static member BeginForm : Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper * string * string -> Microsoft.AspNetCore.Mvc.Rendering.MvcForm
<Extension()>
Public Function BeginForm (htmlHelper As IHtmlHelper, actionName As String, controllerName As String) As MvcForm

Parameters

htmlHelper
IHtmlHelper

The IHtmlHelper instance this method extends.

actionName
String

The name of the action method.

controllerName
String

The name of the controller.

Returns

An MvcForm instance which renders the </form> end tag when disposed.

Remarks

In this context, "renders" means the method writes its output using Writer.

Applies to