Problem with password fields on post back

S

Simon Harvey

Hi all,

Can anyone help me with the following:

I have a page that has a couple of password fields - txtPassword and
txtConfirmPassword

I also have a need on this page to do postbacks and then reload the page.
The problem is that when the page reloads, the password fields are empty.
They havent been reinitialised using the viewstate.

I realise this is a useful security precaution, but is there anyway I can
either turn this functionality off or circumvent it as it isnt appropriate
on this particular page?

Thanks all

Simon
 
S

Simon Harvey

Thats an interesting idea Curt.

I didnt think that the standard textbox had support for masking.

Does it just work that you can get the text out of the text box as normal,
but the text is obscured somehow?

Thanks for your help!

Simon
 
C

Curt_C [MVP]

use two textboxes perhaps? This would be a lot of clientside but have the
keystroke write the current value to a hidden textbox and replace the
visible one with ***.
Never tried this but it may work.

How about explaining WHY you need to have it postback AND keep the password
visible. Maybe there is a better way to accomplish what you are after.
 
S

Simon Harvey

The reason why I have to do this is that I have a form that allows the
system admin of a website to create a new user for the site.

He needs to put in various details including an initial password for the
user. The user changes this at first login.

Also on the page are two list boxes, the first containing all available
roles, and the other containing any roles that you want to assign to the new
user. When you click to add a role to the user, the postback occurs.

Any thoughts would be great. Thanks for your help

Simon
 
C

Curt_C [MVP]

after he postsback if the pass is saved why display it again? If there is a
problem saving it's pretty common to have to reenter the pass, just leave it
at that.
 
P

Paul Drust

Simon,

You may not want to put your passwords into a hidden text field simply
because it is in plain text if someone does "View Source" on the page
(perhaps not an issue).

Might I suggest a few other possibilities:
(1) Rearchitect the "roles" handling so it doesn't require a postback
(don't know what you code is doing, so I can't tell if this is
feasible).
(2) Make the password change and the "roles" handling separate
processes on two different pages.
(3) Make the user save the password changes before performing the
"roles" processing. After the postback, the password fields would be
blank, but they would already be saved. Not the nicest UI
implementation, but there it is.

Good luck.

-- Paul
 
J

J Sahoo

I have the same problem but so far I have not got any real solution as
how to handle it. If anybody can provide some sample code, it will be
a great help. May be somebody from Microsoft should provide some help.

Thank you.

Sahoo J
 

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,777
Messages
2,569,604
Members
45,227
Latest member
Daniella65

Latest Threads

Top