I have Edit Action with Html.BeginForm. How can I add HTML attributes?
Html.BeginForm
I know only one way:
@using (Html.BeginForm(\"Edit\", \"Clients\"
If this might be helpful for some people, this works for me:
@using (Html.BeginForm("RefreshData", "Home", FormMethod.Post, new { Id = "timerangeId", @name = "timerange" })) { // form elements and input }
In Javascript:
document.getElementById("timerangeId").submit();