textbox postback

M

mkiger

Hey Guys,
Here is my problem:
1. I have a site with a page that allows users to create trial accounts.
2. I have 2 textbox controls set to 'password' for trial users to type and
then retype thier passwords.
3. I have a check box for "i have read the agreement and...." etc.
4. When the checkbox is checked, a 'create account' button is enabled; this,
of course, causes a postback.
5. After the postback, all of the textboxes keep thier values except for the
2 password fields.
I would like the 2 password fields to keep thier value. Has anyone found a
way around this?
 
V

Visar Gashi, MCP

When you use a TextBox in Password mode, it disables its ViewState. You could
create your own PasswordBox control that inherits from the TextBox control
and override the OnRender method to show this information.

Not knowing what your application is, I must say that I wouldn't recommend
doing so. While retyping passwords is annoying at times, it is a better
solution than sending the passwords round-trip multiple times.

Alternatively, why don't you allow inputting the password after you make
sure everything is ok on the page?

Regards,
-Visar
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,992
Messages
2,570,220
Members
46,807
Latest member
ryef

Latest Threads

Top