ASP:Textbox with textmode property set to "Password"

I have an ASP:TEXTBOX with the TEXTMODE property set to "Password".  I'm loading it with data in the Page_Load event from a SqlDataReader.  The SqlDataReader has data.  When the Page_Load event is fired, the textbox shows the value in plain text instead of showing asteriks (*).  I need to show the value of the textbox in * and not in plain text

Thanks in advance !!!
Sashi RachabattulaSCRUM Master, .NET Project LeadAsked:
Who is Participating?
Rodney HelsensConnect With a Mentor Commented:
The ASP.NET server control is designed to work this way... in order to get around this you can use the standard input type=password, or assign the password to the textbox via code by adding attribute "value"

Here is an example from googe groups.

  Private Sub Page_Load _
  (ByVal sender As System.Object, _
  ByVal e As System.EventArgs) _
  Handles MyBase.Load
    TextBox1.Attributes.Add("value", "thePassword")
  End Sub

taken from
well it doesnt make sence to show it in *...if u dont want anybody to see it why load it
I totally agree with razo here. If you dont want to show it then why load it and try and display it as *'s
Never miss a deadline with

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Sashi RachabattulaSCRUM Master, .NET Project LeadAuthor Commented:
Thanks for the reply !!!

My requirement is as follows :-

I need to show the user the values for the textbox in *'s, so that an user can modify his password without any breach of security i.e., no other person standing or sitting behind or beside the user cannot be able to see as well including the user himself or herself.  The textbox should populate with the *'s instead of text.  

Rodnex the code mentioned by you is already done by me but was not able to show the values in *'s.  I cannot use <input type=password> since I am not supposed to use it.  This has to be done using <ASP:Textbox> control only.

Thanks in advance !!!!!
stumpy1Connect With a Mentor Commented:
You are not showing the user any value in the textbox, all you want to show is *'s for each character. All that would do is let someone onlooking calculate how long that users password is. It is of no value showing *'s. The user can type in a new password without the textbox being populated with *'s.

If you want to show something in the textbox, why dont you just populate it with an arbitary number of *'s, its not like it makes any difference???

The only place Ive ever seen a password field pre-populated is in Windows. Even then its only an arbitary number of *'s, it doesnt do a direct display of 1 * for each character in the password.

If you *really* do need to show the password as *'s, do the translation through your code-behind and display a * for each character in that users password.
The asker received several suggestions and I believe they got their solution through this question and the experts should be acknowledged even though the asker seems to have abandoned it
Rodney HelsensCommented:
I agree, we offered solutions to the problem and the asker has neglected to award points.
Sashi RachabattulaSCRUM Master, .NET Project LeadAuthor Commented:
Sorry for delay mates
No problem. We all get distracted now and again. Thanks
All Courses

From novice to tech pro — start learning today.