reaz
reaz

Reputation: 735

Textbox auto fill in asp.net

Can anyone tell me how to disable autofill for text boxes in asp.net?

to get a better Idea :

In the Login webpage. When a user provides a username and password there is also a (Remember Me) check box for next time login... So far, everything is fine.

but the problem appears in the registration form, when the user opens the register page, both fields (username and password ) are filled out with the users name and password used for the previous login.

Does anyone have an idea about this problem?

Note: I have tried these two lines of code in page load event, but it didn't work.

txtUsername.Text="";
txtPassword.Text="";

I will appreciate every single answer.

Upvotes: 6

Views: 5711

Answers (3)

Chetan Sanghani
Chetan Sanghani

Reputation: 2111

<asp:TextBox Runat="Server" ID="xyz" autocomplete="off" />

Or try this In From Tag

<form autocomplete="off" ...

Upvotes: 4

mehdi
mehdi

Reputation: 1755

and for your from :

<form id="register" autocomplete="off" method="post" runat="server">
                      ^ THIS ATTR

Upvotes: 3

enb081
enb081

Reputation: 4061

You can disable autofill for the TextBoxes by adding autocomplete="off":

<asp:TextBox Runat="server" ID="txtUsername" autocomplete="off"></asp:TextBox>

<asp:TextBox Runat="server" ID="txtPassword" autocomplete="off"></asp:TextBox>

Upvotes: 9

Related Questions