Solved

ASP:Textbox with textmode property set to "Password"

Posted on 2004-10-11
10
1,197 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
 
LVL 4

Author Comment

by:Sashi Rachabattula
Comment Utility
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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 5

Assisted Solution

by:stumpy1
stumpy1 earned 100 total points
Comment Utility
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
Comment Utility
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
Comment Utility
I agree, we offered solutions to the problem and the asker has neglected to award points.
0
 
LVL 4

Author Comment

by:Sashi Rachabattula
Comment Utility
Sorry for delay mates
0
 
LVL 5

Expert Comment

by:stumpy1
Comment Utility
No problem. We all get distracted now and again. Thanks
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

771 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now