Chrome Autofill my first textbox in every page with logged user name. I tried different method like
autocomplete="off"
But this is not working.
<asp:TextBox ID="txtSearch" runat="server" Width="200px" Text="" >
Chrome Autofill my first textbox in every page with logged user name. I tried different method like
autocomplete="off"
But this is not working.
<asp:TextBox ID="txtSearch" runat="server" Width="200px" Text="" >
I would suggest that you make a hidden Textbox
with the name
and id
username or email.
Update: Chromium should be ashamed. Sadly, they didn't fix the problem and may do so in the near future. See the links below:
https://bugs.chromium.org/p/chromium/issues/detail?id=370363#c7
As a result, it seems the only practical, if not perfect, solution. Chromium ignores hidden TextBoxes (display: none) so it won't work. I suggest hiding the fake userName TextBox with zero width or height or positioning it outside the browser viewport.
This is an example:
<input type="text" id="username" name="username" style="position: fixed; font-size: 0px; width: 0px; height: 0px; top: -500px; left: -500px;" />
Please make this as below in code behind.
txtSearch.Attributes.Add("autocomplete", "off");
you can check attached screenshot.