c# - How do I stop the browser storing form data which user entered in text fields -


I do not know whether this is a simple task, but I tried to search in Google but found nothing.

I have an asp.net form and records some data in the text box given by the user. Whenever the user submits the form, the browser saves that form data. I do not want to save this form data in the browser. How can I restrict the browser that saves this form data without touching the browser settings?

The application has been developed using ASP.NET and here the general text box is used.

I'm guessing that you want to stop remembering the browser entries, Is the autocomplete?

  & lt; Input type = "text" name = "text1" autocomplete = "off" & gt;  

Or it will work in FF and IE, but this is not the XHTML standard:

  & lt; Form name = "form1" id = "form1" auto-complete = "off" />  

Note that Autocomplete is defined only in HTML 5 standards, so it will break any validity that you run against HTML 4 .

If not, just on postback, simply clear the input:

  TextBox.Text = string.Empty;  

Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -