0

i have one textbox for password, n i want to set character for password, so which property can be used?

7
Contributors
7
Replies
29
Views
6 Years
Discussion Span
Last Post by Mayur Darji
0

You can set the TextMode property of Textbox to Password...

i have one textbox for password, n i want to set character for password, so which property can be used?

0

To set password character in asp.net you will have to set two properties of text box.
1> TextMode="password"
2> PasswordChar = "*" or any other character like "@".

0

if it is an mvc project use

 import the model in the top of the razor view file

 add this line of code to generate the password box
 @Html.PasswordFor(m=>m.Password)  -- This would be in your view


 in your model

 public class LoginView{

    public string Username {get;set;}

    [DataType(DataType.Password)]
    public string Password {get;set;}

 }
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.