我使用EditorforModel登录页面,这是我的模型
[Required]
public int UserId
{
get; set;
}
[Required]
[DataType(DataType.Password)]
public string Password
{
get; set;
}
[HiddenInput]
[ScaffoldColumn(false)]
public string ReturnUrl
{
get; set;
}这是我的观点:
@model MVCIdentityLogin.Models.LogInModel
@{
ViewBag.Title = "LogIn";
}
<h2>LogIn</h2>
@Html.ValidationSummary(true)
@using(Html.BeginForm())
{
@Html.EditorForModel()
<p>
<button type="submit"> Log In</button>
</p>
}我的视图是:View这个视图的Userid输入域有增加和减少按钮。如何将其移除?我检查这个html,它是
发布于 2017-07-08 20:00:50
只需在Userid属性中添加此DataType(DataType.Text)属性,如下所示
[Required]
[DataType(DataType.Text)]
public int UserId
{
get; set;
}https://stackoverflow.com/questions/44984612
复制相似问题