开发者

Adding id to MVC form input

I have this HT开发者_如何学JAVAML input in a asp.net MVC page:

<%=Html.TextBox("Submission.FirstName", null, new { @class = "fname title" })%>

How can I add an id to it?


simple

<%=Html.TextBox("Submission.FirstName", null, new { @class = "fname title", id = "my-id-here" })%>

After that you will see the id in the html markup after it will be rendered


The id will be set using the name you supply. In this case the id will be "Submission_FirstName".

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜