?
Solved

ASP:Textbox with textmode property set to "Password"

Posted on 2004-10-11
10
Medium Priority
?
1,221 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 400 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 400 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
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 this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses
Course of the Month12 days, 12 hours left to enroll

777 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