日期:2014-05-17 浏览次数:21118 次
@using (Html.BeginForm())
{
@Html.ValidationSummary()
<table>
<tr>
<td>@Html.LabelFor(m => m.UName)</td>
<td>
@Html.EditorFor(m => m.UName)
</td>
</tr>
<tr>
<td>@Html.LabelFor(m => m.UPass)</td>
<td>
@Html.EditorFor(m => m.UPass)
</td>
</tr>
<tr>
<td colspan="2">
<input type="submit" value="提交" /></td>
</tr>
</table>
}
</div>
public int ID { get; set; }
[Required(ErrorMessage = "请输入用户名。")]
[DisplayName("用户名:")]
public string UName { get; set; }
[Required(ErrorMessage = "请输入密码。")]
[DisplayName("密码:")]
public string UPass { get; set; }