I dont know whether this simple task or not, but I tried to search in google but couldn't find anything.
I've a asp.net form and user enters some data in the text boxes provided. Whenever user submits the form, browser will save that form data. I don't want this form data to be saved in browser. How can I restrict the browser saving this form data without touching the browser settings?
Application is developed using asp.net and normal text boxes are used here.
I'm guessing you mean you want the browser to stop remembering values entered, i.e. the browser's autocomplete?
<input type="text" name="text1" autocomplete="off">
Or this will work in FF and IE, but it's not XHTML standard:
<form name="form1" id="form1" autocomplete="off" />
Note that autocomplete is only defined in the HTML 5 standards, so it will break any validations you run against HTML 4.
If not, on PostBack, just clear the inputs:
TextBox.Text = string.Empty;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With