FormExtensionsBeginForm Method |
Writes an opening form tag to the response.
Namespace: Kentico.Forms.Web.Mvc.InternalAssembly: Kentico.Content.Web.Mvc (in Kentico.Content.Web.Mvc.dll) Version: 13.0.131
Syntax public static UpdatableMvcForm BeginForm(
this HtmlHelperExtensionPoint htmlHelper,
string formId,
string updateTargetId,
string actionName = null,
string controllerName = null,
Object routeValues = null,
bool usePostMethod = true,
IDictionary<string, Object> htmlAttributes = null
)
Parameters
- htmlHelper
- Type: Kentico.Web.MvcHtmlHelperExtensionPoint
HtmlHelper extension. - formId
- Type: SystemString
Gets or sets element's ID for the form. - updateTargetId
- Type: SystemString
Gets or sets the ID of the DOM element to update by using the response from the server when form needs to be re-rendered e.g. due to the application of visibility condition.
- actionName (Optional)
- Type: SystemString
The name of the action method that will handle the request. - controllerName (Optional)
- Type: SystemString
The name of the controller that will handle the request. - routeValues (Optional)
- Type: SystemObject
An object that contains the parameters for a route. - usePostMethod (Optional)
- Type: SystemBoolean
When true the HTTP method POST is used for processing the form. If false then GET is used. - htmlAttributes (Optional)
- Type: System.Collections.GenericIDictionaryString, Object
An object that contains the HTML attributes to set for the element.
Return Value
Type:
UpdatableMvcFormReturns an object representing updatable form.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
HtmlHelperExtensionPoint. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
Exceptions Exception | Condition |
---|
ArgumentNullException | Thrown when htmlHelper is null. |
ArgumentException | Thrown when formId or updateTargetId is null or empty. |
InvalidOperationException | Thrown when UpdatableMvcForm are nested. |
See Also