Sunday, July 17, 2011

How to clear the previous history of asp.Net textbox

Its a problem everybody faced in their browser. The browser cookie saved the textbox previous history. Sometimes it become security issue.
Click on image to view large
So we should clear previous history from textbox. So I just write a textbox properties in Page_Prerender event in my page(codebehind).
protected void Page_PreRender(Object sender, EventArgs e)
{
     txtPassword.Attributes.Add(“autocomplete”, “off”)
     txtConfirmPassword.Attributes.Add(“autocomplete”, “off”);
}
Hope It will solve your problem too.

No comments:

Post a Comment

Search This Blog

Visitor Counter