Password fields

mike55

Contributor
Joined
Mar 26, 2004
Messages
727
Location
Ireland
Ok, have a password field on my page. What i would like to do is when the user retrieves data back from the database the password will be displayed in its own field, i tried to do this but the field would n't display the data for security concerns, i assume. Anyone got any suggestion???

Mike
 
Are you asking how to get the password to stay in a password field after posting back and the page is re-displayed? You'd have to get the password on post back, and put that value back in the text box on pre-render. And to tell the truth, while in theory it may work but I've never actually tried it; never had a reason to and password boxes tend to not be very flexible and do things you normally can do. By design a password text box text value may be read-only to .NET; I'd have to look into it.

Back to your question though, it can't be automatically done like the other controls by setting view state true because it's a password text box and .NET won't allow that to happen. Just like you can't cut and paste to a password box; it's that way by design.
 
Back
Top