Showing posts with label password. Show all posts
Showing posts with label password. Show all posts

Monday, March 26, 2012

Populate a Password Textbox from DB

Hello,

I have a query that populates several textboxes on my page.

I have a textbox called tboxPassword and it's type is set to password.

The the query runs, the Password box is left empty. I'm assuming this is some feature of the 'password' type assigned to the box. Is there anyway to overcome this? It's ok if the password still appears as ****, but I'd like it to be in the boxes.

Thanks!
Jason<input type="password" value="PASSWORDHERE" /
<asp:textbox TextMode="password" text="blahblahblah" runat="server" /
In either case, the password will appear as ****, but the underlying HTML (viewable through a simple "View Source") will show the password in plain text. In otherwords, you lose any and all password security by doing this and you shouldnot do it.
Actually, you cannot populate a password textbox from code. Even if you try to assign it a value, hoping it will appear as ****, it will not work.

As pickyh3d said, you shouldn't want to do this.

You can't do it anyway.
heh woops. I never tried it, so I just figured it would work... you could cheat and hard code it into an input tag, but you still shouldn't.

Learn something new everyday.

Wednesday, March 21, 2012

Populate textbox with textmode=password

I'm trying to populate a password style text box from information in a database. It will populate when I change it to a singleline text (or normal) but it will not with a password style. I would like it to populate with the ******* but be able to have the actual data in the background so I can submit it to a database.

ThanksWrite a code behind for this for text change event to change to * from test..

Nor text box has a property of password...

Cheers,
Devendra Naik
It's be design.. but there is a way around it.. instead of changing the Text property, you can do this:


myTextBox.Attributes["value"] = "somethingfromthedatabase";