I am playing around with the ASP.NET MVC Html.Helpers
and I noticed that say for instance:
Html.Textbox("test");
will render the name attribute to "name=test"
and the id
tag will be "id=test"
But when I do this:
<%= Html.TextBox("go", null, new { @name = "test2", @id = "test2", @class = "test2" })%>
id
will be "id=test2"
but name
will be "name=go"
Why does it not get overridden?
I also don't really still understand what the name
tag actually does. I don't think I ever even used.
P.S
I am aware that "name" and "id" probably don't need to be escaped only "class" does since it is a keyword but I just do it for all of them just so I don't forget to do it or have to even remember if something is a keyword or not.