Solved

ASP:Textbox with textmode property set to "Password"

Posted on 2004-10-11
10
1,203 Views
Last Modified: 2007-12-19
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 !!!
0
Comment
Question by:Sashi Rachabattula
  • 4
  • 2
  • 2
  • +1
10 Comments
 
LVL 8

Expert Comment

by:razo
ID: 12284246
well it doesnt make sence to show it in *...if u dont want anybody to see it why load it
0
 
LVL 9

Accepted Solution

by:
Rodney Helsens earned 100 total points
ID: 12287707
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
http://groups.google.com/groups?hl=en&lr=&threadm=%23WtWX%235XDHA.2200%40TK2MSFTNGP09.phx.gbl&rnum=1&prev=/groups%3Fhl%3Den%26lr%3D%26q%3Dasp%2Btextbox%2Badd%2Battribute(%2522value%2522%252Cpassword)
0
 
LVL 5

Expert Comment

by:stumpy1
ID: 12288775
I totally agree with razo here. If you dont want to show it then why load it and try and display it as *'s
0
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
LVL 4

Author Comment

by:Sashi Rachabattula
ID: 12296443
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 !!!!!
0
 
LVL 5

Assisted Solution

by:stumpy1
stumpy1 earned 100 total points
ID: 12297016
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.
0
 
LVL 5

Expert Comment

by:stumpy1
ID: 12534654
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
0
 
LVL 9

Expert Comment

by:Rodney Helsens
ID: 12536182
I agree, we offered solutions to the problem and the asker has neglected to award points.
0
 
LVL 4

Author Comment

by:Sashi Rachabattula
ID: 12547762
Sorry for delay mates
0
 
LVL 5

Expert Comment

by:stumpy1
ID: 12553391
No problem. We all get distracted now and again. Thanks
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question