I've created MVC5 app and I use the following code in create mode when user type passowrd(show asterisks ) and Its working fine .In display mode I want to display just the asterisks (not empty text box) for the field which the user type password ,how should I do that?
this is the code in the create
<div class="form-group">
@Html.LabelFor(model => model.Password, new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.Password("password", "", new { id = "password", Textmode = "Password" })
</div>
</div>
You can use placeholder attribute:
<div class="form-group">
@Html.LabelFor(model => model.Password, new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.Password("password", "", new { id = "password", placeholder = "***", Textmode = "Password" })
//or for displaying, just type
<label>*****</label>
</div>
</div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With