I just tested this solution with MVC5 .net 4.5.1. I was trying to set manually the form Id because I was going to have several forms in the same page and I needed to control then separatelly with JS :
@using (Ajax.BeginForm("Edit", "Products", null, new AjaxOptions { HttpMethod = "POST", UpdateTargetId = "divEmp"+Model.Id }, htmlAttributes : new { id = "form_"+ Model.Id } )){}
Enfasis in last parameter: htmlAttributes : new { id = "form_"+ Model.Id }
It is the same with @Html.BeginForm()
and other helpers.
The htmlAttributes:
part is not really necessary.