Reputation:
How to disable browser's autocomplete effect on all textboxes in asp.net c# application. I have tried following jquery but it doesn't works
$(document).ready(function () {
$("input[type=text]").attr("autocomplete", "off");
});
Please help me !!!
Upvotes: 1
Views: 2962
Reputation: 99
If you are using c#, you can use this code inside the form. This will disable all the controls autocomplete inside the form.
<form id="Form1" method="post" runat="server" autocomplete="off">
If you want to disable individually, you can use this code.
<asp:TextBox Runat="server" ID="Textbox1" autocomplete="off"></asp:TextBox>
Or you can change the autocomplete at run time:
Textbox1.Attributes.Add("autocomplete", "off");
Upvotes: 1
Reputation: 1861
Add autocomplete="off" attribute in input control.
<input autocomplete="off" id="name" type="text" name="name">
Upvotes: 1
Reputation: 470
Set the ViewStateMode
property of the textbox to Disabled . Should work for you.
Upvotes: 0