Prevent textbox autofill with previously entered values

JosephStyons picture JosephStyons · Mar 13, 2012 · Viewed 112.5k times · Source

I have an asp page with some Textbox controls on it.

By default, the browser will suggest previously entered values for each box.

I'd like to prevent that behavior for some of the textboxes.

Is there a way to reliably do that across all major browsers?

I've tried setting

AutoCompleteType="Disabled"

But that seems to have no effect in Firefox.

Here is an image of the behavior I'm trying to prevent.

enter image description here

Answer

PraveenVenu picture PraveenVenu · Mar 13, 2012

For firefox

Either:

<asp:TextBox id="Textbox1" runat="server" autocomplete="off"></asp:TextBox>

Or from the CodeBehind:

Textbox1.Attributes.Add("autocomplete", "off");