Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TextMode problem...

Status
Not open for further replies.

Sheffield

Programmer
Jun 1, 2001
180
US
Greetings,

I'm displaying the results from an query into a series of TextBoxes. One field is a user's password, where it has the Input Mask property in MS-Access set to 'Password'. When the table is viewed in Access, all entries in this field (user passwords) are 'masked' with asterisks '*'.

However, on the ASP.NET page, the alphanumeric text of the password is displayed clearly visible (no asterisks).

I'm converting a ColdFusion app to ASP.NET. Suprisingly, ColdFusion doesn't have a problem with this and correctly displays the asterisks. I'm a dot.net beginner, so I'm sure I'm unaware of something here. I initially thought I could set the TextMode property to 'password' but that only works for keystrokes into the TextBox.

Can somebody please clue me in?



Thanks
 
Sheff: sounds like a reverse problem you have here. I suppose it is important that the "number of dots" are the same (as if someone is going to count them?). I would just populate a hidden text box with the password; and then do a simple Lenght count and add a dummy number of dots to your displayed textbox (carry this out On Page Load). Just an idea. Something like...

Dim strPWord As String
Dim intCt As integer
intCt = Len(txtRealPassword.Text)
For i = 0 to intCt
strPWord += "*"
Next

..something simple like that. I do not off hand know of a a way to convert Password text into regular text.
 
Or, you can use Regular Expression to take care of it:

Dim s As String = "br2ia5n"
Dim objRegex As Regex
txtPassword.Text = objRegex.Replace(s, "\w", "*")

...but make sure that your TextMode property is not set to Password.


regards,
Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top