473,513 Members | 11,702 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Password Fields and Postbacks

dwa
All,

We're trying to determine how to deal with password fields losing their
state on a post back.

We've got a form that implements post backs to carry out server side
processing. As a result of the post back, passwords entered by the user
lose their values and the user gets an error message upon final validation
when they submit. Here's an illustration:

1. Password : [ ]

2. Confirm: [ ]

3. Select something from a list: [ ]
// this could cause a post-back, which wipes out the passwords

4. Some other field: [ ]

5. Hit submit key

After hitting the submit key (5), the user gets an error message, because
the passwords are now blank as a result of the post back in step #3. What
techniques should be used to get around this? We've tried fiddling with
the VIEWSTATE, to remember values, but it seems like their should be better
way... (?)

-- dwa
Nov 18 '05 #1
1 2360
There is a reason why passwords don't survive postbacks, and it's built into
the browser. In fact, if you enter a password into a password field in any
HTML form, navigate away from it, and return to the page using the Back
button, the form fields will all have their values, EXCEPT for the password
fields. Why? To prevent anyone from stealing another person's password by
doing so. Even if you manage to circumvent this, and I can think of one or
two ways you might, are you sure you want to abandon the security that this
affords, which all browser manufacturers seem to think is extremely
important?

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"dwa" <da@hotmail.com> wrote in message
news:ea**************@TK2MSFTNGP11.phx.gbl...
All,

We're trying to determine how to deal with password fields losing their
state on a post back.

We've got a form that implements post backs to carry out server side
processing. As a result of the post back, passwords entered by the user
lose their values and the user gets an error message upon final validation
when they submit. Here's an illustration:

1. Password : [ ]

2. Confirm: [ ]

3. Select something from a list: [ ]
// this could cause a post-back, which wipes out the passwords

4. Some other field: [ ]

5. Hit submit key

After hitting the submit key (5), the user gets an error message, because
the passwords are now blank as a result of the post back in step #3. What
techniques should be used to get around this? We've tried fiddling with
the VIEWSTATE, to remember values, but it seems like their should be better way... (?)

-- dwa

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
6045
by: Lobang Trader | last post by:
Hi all, I am trying to create a username and a password class. I would like to know what are the RECOMMENDED minimum and maximum length for both fields? These fields will be something like...
20
3508
by: David | last post by:
Hi, I have a field from my recordset called RS("Password"). If I wish to display each character as an asterix '*' how do I go about it. I've seen the replace function, but cannot work out how...
7
8679
by: Mike | last post by:
I've been trying for the past week to put a simple code together. I have done a LOT of searching, found scripts showing the functions I would like to use, however when I mix them it all goes wrong,...
8
2119
by: dwa | last post by:
All, We're trying to determine how to deal with password fields losing their state on a post back. We've got a form that implements post backs to carry out server side processing. As a...
7
1373
by: Simon Harvey | last post by:
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...
2
2696
by: Nathan Sokalski | last post by:
I have a form, and when the form does a PostBack (I have several areas on the form where the form changes if the user selects a different RadioButton), the Password field is cleared, even though I...
2
1822
by: ganapathybabu | last post by:
I've used passwordfields, the form is being postback several times during change event of DropDownList.During that time the password textboxes are getting cleared making the user to input the...
1
4210
by: jqheller | last post by:
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...
3
2986
by: Nathan Sokalski | last post by:
I have an UpdatePanel that needs to maintain the value of several TextBoxes with TextMode=Password. Since the browser clears all password fields client-side, I obviously need to use JavaScript to...
0
7254
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7153
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7432
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5677
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4743
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3218
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1585
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
796
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
452
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.