losing content of password TextBox control inside of a TemplatedWizardStep

J

jqheller

Folks I am losing my mind trying to work with the
TemplatedWizardStep. I have created a multistep user registration
form that collects plenty of user information including a password.
At the end of the process I am finding that the value of my password
control is blank. When I set the textmode of my textbox to
singleline, the value is preserved. It is just when the textbox is
set to password that I lose the value.
I am casting to the password box in the following way:

// make reference to the password step
TemplatedWizardStep passwordStep = SelectPasswordStep;

// password step
TextBox PasswordChoice =

(TextBox)passwordStep.ContentTemplateContainer.FindControl("Password");

Response.Write(PasswordChoice.Text);



This is the same way that I cast to the other controls and I have no
issues. I understand that I can't reset the value of the password
textbox, but that isn't what I'm trying to do. I just need to be able
to read it at the end of my process to create the user's account.

I have been at this for most of the week now. Is it just not possible
to keep the value of a password textbox inside of a
templatedwizardstep? I can't be the first person to use these
controls for the purpose of creating a user account..

Any help would be appreciated.

Thanks,
JQ
 
T

Teemu Keiski

Hi,

I think it relates to that, that in password mode, TextBox doesn't restore
the value from posted data. That is, if you have more than one postback
between setting the password and reading it, it contains nothing. You need
to read the pwd on the next postback (or store it immediately to session or
something on the subsequent postback)

But note that password TextBox's value can be set or you can create custom
pwd control to hold the value over multiple postbacks:
http://aspadvice.com/blogs/joteke/a...-to-set-text-to-a-Password-TextBox_3F00_.aspx
 

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,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top