I am trying to replace the following html textbox using html helpers for asp.net mvc3 application.
<input name="Name" id="add-student-name" type="text" maxlength="50" />
I tried with the following but on rendering I found it is not matching with the above html markup.
@Html.TextBox("Name", new {id="add-student-name", maxlength="50"})
Can anyone help me to resolve the above issue?
Add null as the second argument (your html attributes go in as the third argument)
@Html.TextBox("Name", null, new {id="add-student-name", maxlength="50"})
Been a few years since I did asp.net but I'm pretty sure that'll turn out to be your issue.