Tutorials and code for ASP.NET 2.0,C#,SQL Server,AJAX tutorials,jQuery  
Home    Articles    Contact Us
 

ASP.NET
AJAX
Interview Questions
Sql Server
Technology News
Tips and Tricks
jQuery

 

How to disable Auto Complete feature


By default Auto Complete feature is enabled in all browsers.To disable auto complete use AutoCompleteType poperty of text box.

<asp:TextBox id="txtname" runat="server" AutoCompleteType="disabled"></asp:TextBox> or

<asp:TextBox id="txtname" runat="server" AutoCompleteType="none"></asp:TextBox>

From code behind: txtname.AutoCompleteType=AutoCompleteType.Disabled 

 or txtname.AutoCompleteType=AutoCompleteType.None

This work in IE but not work in FireFox.So,for FireFox use autocomplete property.

<asp:TextBox id="txtname" runat="server" autocomplete="off"></asp:TextBox>

From code behind: txtname.Attributes.Add("autocomplete", "off")

Also,AutoCompleteType creates a list of values entered in a text box. When using the text box again, a list of previously entered value is displayed.When this property is enable text box have a yellow background on loading by default.

<asp:TextBox id="txtname" runat="server" AutoCompleteType="FirstName" runat="server"/>



User Comments:




Post Your Comment :


Name
Email:
Comment:

Home | Contact Us

© 2008-09 TechnoReader.com. All rights reserved.