Home > ASP.NET > How to display the password even textmode=”password” to textbox again?

How to display the password even textmode=”password” to textbox again?

Few days back i was trying to get  stored password  into the ‘asp:textbox’  with textmode=”Password”.

I just wanted to see the stored password , like there are some scenarios where you need to show the stored password “NOT Text” but  in “* * * * ..”.

In my case, Initially password entered in txtPassowrd was stored in xml and i was required to get the password from xml and display the password in the textbox.

As there are many scenarios in which we need to show password again, hmmm as in update profile cases.

After some R&D , finally solution was in my arms :).

Solution to this was in just one line :).

textPassword.Attributes.add(“value”,”password”);

just pass the text [stored password] to “password” and it will work for you.

 password

Thanks.

Advertisements
  1. June 3, 2011 at 8:25 pm

    hi
    thanx, this helped me a lot, actually i was trying to solve this issue with the help of view-state but your post easily solved my problem without any extra effort.

    thanx, keep it up.

  2. Shoaib Adil
    June 5, 2011 at 12:15 am

    Nice workaround for some viewstate or hidden field. infact i think its a better and cleaner way for this. Good going… and HAPPY CODING

  3. June 6, 2011 at 9:56 am

    Thanks for liking and appreciation guys.

  4. Amrutha
    September 17, 2012 at 2:30 pm

    Hi,
    Thanks. Its helped me a lot… Good Job.

    Keep it up..

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: