473,403 Members | 2,323 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

How to keep the password in a password field when page post back?

For a HTTP textbox with a Type of "password", the default
behaiver is that the field will be cleared out when the
page is posted back. This make sense in most of the cases.
But in some situation, it become problematic. In our
asp.net applicaiton, I would like to keep the password in
the field, if the page is posted back. Is this possible?
how?

Thanks
Nov 18 '05 #1
4 4538
have you tried enableviewstate="true" for the password textbox control?

"feng" <an*******@discussions.microsoft.com> wrote in message
news:0c****************************@phx.gbl...
For a HTTP textbox with a Type of "password", the default
behaiver is that the field will be cleared out when the
page is posted back. This make sense in most of the cases.
But in some situation, it become problematic. In our
asp.net applicaiton, I would like to keep the password in
the field, if the page is posted back. Is this possible?
how?

Thanks

Nov 18 '05 #2
You could probably use client-side script to copy the field to a hidden
input control, then on page render, copy it back using Javascript. But why?

--
Thanks,

Eric Lawrence
Program Manager
Assistance and Worldwide Services

This posting is provided "AS IS" with no warranties, and confers no rights.

"feng" <an*******@discussions.microsoft.com> wrote in message
news:0c****************************@phx.gbl...
For a HTTP textbox with a Type of "password", the default
behaiver is that the field will be cleared out when the
page is posted back. This make sense in most of the cases.
But in some situation, it become problematic. In our
asp.net applicaiton, I would like to keep the password in
the field, if the page is posted back. Is this possible?
how?

Thanks

Nov 18 '05 #3
depending on implementation you can also use

if Page.IsPostBack then
myPasswordField.Text = "..."
end if
"feng" <an*******@discussions.microsoft.com> wrote in message
news:0c****************************@phx.gbl...
For a HTTP textbox with a Type of "password", the default
behaiver is that the field will be cleared out when the
page is posted back. This make sense in most of the cases.
But in some situation, it become problematic. In our
asp.net applicaiton, I would like to keep the password in
the field, if the page is posted back. Is this possible?
how?

Thanks

Nov 18 '05 #4
Well, I have a login page that has two tabs on it. There
are different passwrod fields on each tab. I know this
sounds strange but it is the business requirement of the
product. When use switch between tabs, a post back is
required. And that's where my problem comes.

When user fill out the password field on the first tab and
switch to the second tab, then if for some reson he wants
to go back to the first tab, geuss what, the password
field is cleard and he has to re-fill it again.

My client found this behaivor is confusing and
frustrating. They want me to keep the password in the
field after post back.

Thank you for your suggestion, but is there any way this
can be done from the server side? or using features of the
control itself?

Thanks

-----Original Message-----
You could probably use client-side script to copy the field to a hiddeninput control, then on page render, copy it back using Javascript. But why?
--
Thanks,

Eric Lawrence
Program Manager
Assistance and Worldwide Services

This posting is provided "AS IS" with no warranties, and confers no rights.
"feng" <an*******@discussions.microsoft.com> wrote in messagenews:0c****************************@phx.gbl...
For a HTTP textbox with a Type of "password", the default behaiver is that the field will be cleared out when the
page is posted back. This make sense in most of the cases. But in some situation, it become problematic. In our
asp.net applicaiton, I would like to keep the password in the field, if the page is posted back. Is this possible?
how?

Thanks

.

Nov 18 '05 #5

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

Similar topics

7
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
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...
1
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 result...
6
by: James | last post by:
Have a textbox that's in Password mode on a user creation page. Have several dropdowns that cause a PostBack out of necessity on this page. I cannot separate them. When one of these dropdowns...
5
by: accessman2 | last post by:
Hi, I have a question. I made the create the new user form. <script language="javascript"> function submitFrm() {
4
by: df | last post by:
We all know we can keep value of server control between post-back,but how can do this with web form class member properties?For example,I want to decare a class member property as array,to store...
1
by: roshina | last post by:
Hi Iam facing a problem in my project, developing a web site for online shopping in ASP on windows XP using IIS server. All the validations are ok but the new password is not upadated in the data...
2
by: =?Utf-8?B?TW9uaWNh?= | last post by:
Dear reader, how can I keep my password content when a postback occur? I define an edit box in password textmode. but when a postback occur and my page became refresh, its content would be...
1
by: Andrew Murray | last post by:
I'm a novice at coding and cannot get the script below to work I'm receiving an Error 500 in the web browser when trying to run this script. The site is www.murraywebs.com and the link is...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.