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.
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>
<asp:TextBox Runat="Server" ID="xyz" autocomplete="off" />
Or try this In From Tag
<form autocomplete="off" ...
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