Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert textbox type to password in asp.net mvc

Tags:

asp.net-mvc

How do I convert a textbox type to password in asp.net mvc?

like image 573
Fraz Sundal Avatar asked May 24 '10 13:05

Fraz Sundal


People also ask

What is HTML EditorFor in MVC?

ASP.NET MVC includes the method that generates HTML input elements based on the datatype. The Html. Editor() or Html. EditorFor() extension methods generate HTML elements based on the data type of the model object's property.


2 Answers

Just write in Razor View i.e. in .cshtml file below line

  @Html.PasswordFor(m=>m.Password) 

Here m is model object and password is the password field name.

like image 89
Ravinder Gangadher Avatar answered Oct 30 '22 20:10

Ravinder Gangadher


You mean <%=Html.Password("test")%>?

like image 42
Palantir Avatar answered Oct 30 '22 19:10

Palantir