I want to manually define id and name for textbox like that:
<%: Html.TextBoxFor(model => model.Name, new { @id = "txt1", @name = "txt1" })%>
But only the id is changed, not the name attribute, why?
<input id="txt1" name="Name" type="text" value="">
Thank you!
You can't use the strongly typed lambda version for this, you'd need to use the older version
Html.TextBox("txt1",new {@id = "txt1"})