Is it possible when using Html.TextBoxFor
to override the name attribute?
I have tried with no success. I need to use TextBoxFor to get client side vali
For this example, I was disabling form fields based on permissions, but still showing them. I had a hidden field to send the value to the controller, but wanted a different field name in the EditorFor. First param after model value represents the "name" property, second is the new name.
@Html.EditorFor(m => m.UserName, "name", "UserNameDisabled", new { htmlAttributes = new { @class = "form-control", @disabled = "disabled"} });
Results in: