Disable Autocomplete TextBox in Websites:
Here in this article i am going to discuss about how to dissable the autocomplete textbox in websites.This is a very basic and important concept i am going to discuss.I have involved in working with several websites,while creating a website we need not pay attentation about several small mistake,but this would be vary dangerous while move to the production.
So here i am going to discuss such a issue which need to pay attentation while developing.Here i am showing what actually autocomplete of a textbox.
Here i have created Login Form which i have shown below.
So here i am going to discuss such a issue which need to pay attentation while developing.Here i am showing what actually autocomplete of a textbox.
Here i have created Login Form which i have shown below.
Here is the Html code for this webform.

- <body>
- <form id="form1" runat="server">
- <div style="margin-left:200px;margin-top:200px; background-color:azure;width:300px">
- <table>
- <tr>
- <td>
- UserId:
- </td>
- <td>
- <asp:TextBox runat="server" ID="txt_userid"></asp:TextBox>
- </td>
- </tr>
- <tr>
- <td>
- Password:
- </td>
- <td>
- <asp:TextBox runat="server" ID="txt_password" TextMode="Password"></asp:TextBox>
- </td>
- </tr>
- <tr>
- <td>
- <asp:Button runat="server" ID="btn_submit" Text="submit" />
- </td>
- </tr>
- </table>
- </div>
- </form>
- </body>

We can dissable this autocomplete in two label.
- In browser Label
- In Coading Label
- Using AutoCompleteType="Disabled" of a textbox.
- Using autocomplete="off" of a textbox.
- Setting form autocomplete="off".
- setting textbox attribe.
- Using Jquery.
Here i am going to show how to dissable in browser Label.
Go to the Browser Setting.

Go to the Advance Setting and Check for Passwords and Forms.
Unckeck the the two checkbox.


Then Reset all changes.

After that open that open the Login page and type that no auto suggesation will found. So in this way we can dissable the autocomplete in browser label.

After that open that open the Login page and type that no auto suggesation will found. So in this way we can dissable the autocomplete in browser label.
In Coading Label
By making AutoCompleteType="Disabled",
By setting autocomplete="off",
By Setting Form autocomplete="off",
- <asp:TextBox runat="server" ID="txt_userid" AutoCompleteType="Disabled"></asp:TextBox>
- <asp:TextBox runat="server" ID="txt_userid" autocomplete="off"></asp:TextBox>
- <form id="form1" runat="server" autocomplete="off">
- //your content
- </form>
By using code in .cs page,
- protected void Page_Load(object sender, EventArgs e)
- {
- if (!Page.IsPostBack)
- {
- txt_userid.Attributes.Add("autocomplete", "off");
- }
- }
By Using Jquery
and here is my textbox in <body>,
- head runat = "server" >
- < title > < /title> < script src = "Scripts/jquery-1.6.4.min.js" > < /script> < script type = "text/javascript" >
- $(document).ready(function()
- {
- $('#txt_userid').attr('autocomplete', 'off');
- });
- //document.getElementById("txt_userid").autocomplete = "off"
- < /script>
- <asp:TextBox runat="server" ID="txt_userid" ></asp:TextBox>
By Setting textbox attribute in code,
- protected void Page_Load(object sender, EventArgs e)
- {
- if (!Page.IsPostBack)
- {
- txt_userid.Attributes.Add("autocomplete", "off");
- }
- }
So in this way we can dissable autocomplete textbox in webform.After dissabling the text will not appear.

Hardik VadherPosted Dec 2, 2020, 4:19 AM
Place below code above your username control. This will work in call the browser. <div style="margin-left:-99999px; height:0px;width:0px;"> <input type="text" id="cc" name="cc" autocomplete="off"> <input type="password" id="cc1" name="cc" autocomplete="off"> </div>
Bhavleen SinghPosted Aug 8, 2019, 10:30 PM
None of them work
Kashif AliPosted Aug 13, 2018, 12:57 AM
I Tried All Of Them But Not Working