I am using @Html.BeginUmbracoForm("Action", Controller") to render a form and I thought I would be able to pass the following code to render a unique form ID:
new { @id = "frmMainContact" }
@Html.BeginUmbracoForm("Action", "Controller", new { @id = "frmMainContact" })
How to add a form id to Html.BeginUmbracoForm
Hello Umbracians.
v6.1.6, Mvc - Razor
I am using @Html.BeginUmbracoForm("Action", Controller") to render a form and I thought I would be able to pass the following code to render a unique form ID:
new { @id = "frmMainContact" }
Seems I was wrong.
Does anyone know how to do this?
Many thanks
Phillip
I've just tried this in v7.1 and it works fine as you have it.
Can I suggest you try explicitly stating the parameter name in case it's using the wrong overloaded method (not sure this is this even possible?):
Other things I tried was dropping the '@' and variants of case (e.g. Id and ID) - all were correctly output as " <form id="frmMainContact" ..>
I was missing a parameter.
This worked for me:
Thanks for the reply!
is working on a reply...