This is probably a simple thing, but ive got the following code:
<div> @using (Html.BeginForm()) { <p> ... </p> } </div>
And it keeps complaining that the starting { bracket must be followed by a end } bracket, but its there, and all code examples doing this sort of stuff show this as the way to do it, so im a bit baffled as to why it doesn't work...
"BeginForm()" is an extension method that writes an opening "<form>" tag to the response. "BeginForm()" is an extension method for both HtmlHelper and AjaxHelper classes.
Html. BeginForm() will create a form on the page that submits its values to the server as a synchronous HTTP request, refreshing the entire page in the process. Ajax. BeginForm() creates a form that submits its values using an asynchronous ajax request.
Html. BeginForm is the Html Helper Extension Method that is used for creating and rendering the form in HTML. This method makes your job easier in creating form. Here, is the method to create a form using Html.
Thanks for your help ! Multiple form tags should work fine in MVC unless they are nested.
Probably there is an error in the code within the <p>
and </p>
tags.
Try commenting it out and see what the result is:
<div> @using (Html.BeginForm()) { <p> @* = Server side comment out. .... *@ </p> } </div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With