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;
}
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment
It is the same account you read, post and publish with — and you will come straight back to this page.

Abhay ShankerPosted May 11, 2014, 6:19 AM
Thanks...
Lakshmanan Sethu SankaranarayanPosted May 11, 2014, 3:44 AM
nice tip