473,763 Members | 1,373 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4562
have you tried enableviewstate ="true" for the password textbox control?

"feng" <an*******@disc ussions.microso ft.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*******@disc ussions.microso ft.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*******@disc ussions.microso ft.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*******@disc ussions.microso ft.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
8695
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, somehow I always end up with error messages and functions not working right. Can someone please help me? I have a form, inside is 1 Text Field and 2 Password Fields. What I'm looking to do is: - Make sure password fields are equal - Set...
8
2137
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 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
2367
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 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:
6
2370
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 changes, the textbox's value is lost. How do I prevent this? Thanks
5
4538
by: accessman2 | last post by:
Hi, I have a question. I made the create the new user form. <script language="javascript"> function submitFrm() {
4
2441
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 some info very posting,continuely,how to do this? Thanks for any infomation and Happy New Year!
1
7428
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 base and also showing a error page. the operating system we used is Windows XP, the source code is ASP, front end we used - HTML and javascript and vb script for validations. the inputs we used are : old pasword :
2
1332
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 empty. and I have to enter again. what is the best solution to solve this problem? Regards,
1
4885
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 'Retrieve Password' under the logon form. the idea is to submit an email address and the password is emailed to the user. (a very "basic" but common function of user management systems). The script(s) I'm using are based on...
0
9563
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9386
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10145
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9998
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8822
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7366
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6642
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5270
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3917
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 we have to send another system

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.