【发布时间】:2013-11-18 08:37:47
【问题描述】:
我有一个 asp.net mvc4 应用程序,其中有:
<li>
@Html.Label("Login")
@Html.TextBox("Login")
</li>
我想像这样将属性 Required 添加到 TextBox login
<input type="Text name="login" Required />
我该怎么做?
【问题讨论】:
-
@Html.TextBox("Login", null, new { required = "required" }) 应该可以帮助您
标签: asp.net .net asp.net-mvc asp.net-mvc-4 razor