How do I convert a textbox type to password in asp.net mvc?
@Html.EditorFor(model => model.Password,
"Password",
new { htmlAttributes = new { @class = "form-control" } })
<div class="editor-field">
@Html.PasswordFor(model => model.Password, new { htmlAttributes = new { @class = "form-control", placeholder = "Password" } })
@Html.ValidationMessageFor(model => model.Password)
</div>
Convert textbox type to password in asp.net mvc
@Html.EditorFor(model => model.Password, new { htmlAttributes = new { @class = "form-control", placeholder = "Password", @type="Password" } })
When using a strong-typed view and bootstrap, use the following code to make sure the password field is properly styled:
@Html.PasswordFor(model => model.Password, new { @class = "form-control" })
You mean <%=Html.Password("test")%>
?