Reputation: 735
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
Reputation: 2111
<asp:TextBox Runat="Server" ID="xyz" autocomplete="off" />
Or try this In From Tag
<form autocomplete="off" ...
Upvotes: 4
Reputation: 1755
and for your from :
<form id="register" autocomplete="off" method="post" runat="server">
^ THIS ATTR
Upvotes: 3
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