473,587 Members | 2,466 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to Retain Password Fields in ASP.Net 1.1 across Postbacks?

1 New Member
I've used passwordfields, the form is being postback several times during change event of DropDownList.Du ring that time the password textboxes are getting cleared making the user to input the Password again.I went through the Thread posted earlier regarding this but i couldn't understand? Can Anyone help me?
Feb 28 '07 #1
2 1827
julaia
1 New Member
Add the OnPreRender event handler on the password textbox, with the following method body:

protected void txtPassword_Pre Render(object sender, System.EventArg s e)
{
txtPassword.Att ributes["value"] = txtPassword.Tex t;
}

Thus the password should be displayed after postback.
Feb 28 '07 #2
kenobewan
4,871 Recognized Expert Specialist
This is a nice work around:
Expand|Select|Wrap|Line Numbers
  1. protected void txtPassword_PreRender(object sender, System.EventArgs e)
Although, can you avoid having to do this through the design of your form, i.e. don't get them to enter the password until after the other postbacks?
Mar 1 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
4880
by: theo | last post by:
Hi... I wish to extract the text content of an Xml file and assign it to DropDownList controls at runtime.I can get the Xml file text content into the DropDownList controls (Ex...if 5 Xml text tags then 5 dropdownlist controls each containing the 5 Xml text tags). Problem,when I save the user DropDownList selected items by means of a...
8
2127
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. ...
1
2362
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...
7
1379
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 then reload the page. The problem is that when the page reloads, the password fields are empty. They havent been reinitialised using the viewstate.
2
2019
by: Mark | last post by:
I'm adding several controls (labels, etc.) to a placeholder programatically. I'd like the PlaceHolder to maintain these contents during postbacks without having to programmatically recreate their contents. Is there a way to do this? Thanks in advance. Mark
2
2701
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 have EnableViewState set to True. None of the other TextBoxes lose their value. I also tried using Session variables to store the value between...
3
1588
by: Dhruba Bandopadhyay | last post by:
I am using a <asp:TextBox TextMode="Password"... etc. however it doesn't retain it's text through postbacks, whereas other textboxes do. Does anyone know how to retain the text?
2
1508
by: RAM | last post by:
Hello, I am learning ASP.NET 2.0. Could you explain me please the difference when to use fields of a System.Web.UI.Page-derived class and whem I must use Session variable instead. For example I have a class PZ : System.Web.UI.Page and I need to remember CurrentPosition (int) of asp:DataList. Can I use private field of PZ class (even in...
3
2988
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 do this. Can someone help me? Thanks. Nathan Sokalski njsokalski@hotmail.com http://www.nathansokalski.com/
0
8215
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. ...
0
8347
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...
0
8220
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6626
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...
1
5718
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...
0
3879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2358
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
1
1454
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1189
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.