Currently I am working on a client requirement where I have to develop a registration form.
In this form I have used 8 textbox and 8 dropdown list including two text box named Password and confirm Password.
When I was working on this form I found that all the values persist after post back of the page except Password and confirm Password.
Then I searched a solution for this and fixed the issue as below
By writing below code bloc ok page load
if (!(String.IsNullOrEmpty(txtPassword.Text.Trim())) && !(String.IsNullOrEmpty(txtConfirmPassword.Text.Trim())))
{
txtPassword.Attributes["value"] = txtPassword.Text;
txtConfirmPassword.Attributes["value"] = txtConfirmPassword.Text;
}
Retain Password after Postback of the Page in ASP.NET
How to retain Password after Postback of the Page in ASP.NET C#.


Abhay ShankerPosted May 11, 2014, 2:19 AM EDT
Thanks...
Lakshmanan Sethu SankaranarayanPosted May 10, 2014, 11:44 PM EDT
nice tip