我的印象是使用如下注释:
- <required()>
- <DisplayName("Choose a Password:")>
- <ValidatePasswordLength()>
- <DataType(DataType.Password)>
- Public Property Password As String
在视图中使用时会创建一个蒙版字段:
- <%: Html.TextBoxFor(Function(model) model.Password) %>
- <%: Html.ValidationMessageFor(Function(model) model.Password) %>
但是,这是不用type =“password”
什么是“DataType.Password”用于,如果不是这样?