Tuesday, July 10, 2007

Make password fileld not clear when the page is post back


protected void Page_Load(object sender, EventArgs e)
{
//to preserve pasword text at the pose back
txtPword.Attributes.Add("Value", txtPword.Text.ToString());

}

//in the pasword box prerender event
protected void txtPword_PreRender(object sender, EventArgs e)
{
txtPword.Attributes["Value"] = txtPword.Text;
}

No comments: