To create a Password Field in to the Raxor view Page you have to write this below code
@Html.PasswordFor (model => model.Password)
Now there is a alternative way also is there.
In your model class write tour password field property like
[Required(ErrorMessage = "Pass word is required")]
//[ValidatePasswordLength]
[DataType(DataType.Password)]
//[Display(Name = "Password")]
public string Password { get; set; }
and in the razor file then youy have to just write
<div class="editor-label">
@Html.LabelFor(model => model.Password)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.Password)
@Html.ValidationMessageFor(model => model.Password)
</div>
It will automatically take the"*" char when you enter your password value.Because you have already meke in the password property like
"
[DataType(DataType.Password)]
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment
It is the same account you read, post and publish with — and you will come straight back to this page.

Mohan GPosted Apr 23, 2015, 2:33 AM
nice
Chirag RathodPosted Sep 12, 2014, 5:54 AM
Thanxs Dear