How do I convert a textbox type to password in asp.net mvc?
Another way is to add @type = password to your html.texbox() attributes like so:
before converting:
@Html.TextBox("mypass", null, new { @class = "" })
After converting:
@Html.TextBox("mypass", null, new { @class = "", @type = password })
This will mask your text box text with circles instead of text. It does this, because the @type = password attribute tells your text box that it is of type "password".
This method of converting your text box to type password is an easy quick way to to make the conversion from your standard razor form text box.