Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

ASP:Textbox with textmode property set to "Password"

Posted on 2004-10-11
10
Medium Priority
?
1,225 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

636 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