C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Articles » ASP.NET/Web Applications »

ASP.NET - Disabling AutoComplete Feature


Posted Date: 18 Jun 2009    Resource Type: Articles    Category: ASP.NET/Web Applications
Author: Viji RAJKUMARMember Level: Diamond    
Rating: 1 out of 5Points: 10



In Web forms, when we start type in the text box, we will get the values we have typed in that field before. This is known as Auto Complete Feature. This feature is helpful in entering redundant values.

Sometimes we may want to turn off the feature as we should not reveal secret information such as social security number or credit card number.


How to turn off the auto complete feature.


To turn off auto complete for the entire form, all we need to do is add an attribute to our form tag, like this:



< form id="Form1" method="post" runat="server" autocomplete="off" >

.....

< /form >




How to turn off auto-complete feature in Control

We can do it at design time or at run time.

At design time:

Drag the asp text box control and place on the form and include the following



< asp:TextBox Runat="server" ID="Textbox1" autocomplete="off" >< /asp:TextBox >




But note that VS.NET will underline it with a squiggly saying that textbox does not have an attribute for autocomplete - but it will still work

At runtime:



Textbox1.Attributes.Add("autocomplete", "off");






Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
ASP.NET - Disabling AutoComplete Feature  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Storing/Retrieving Files into/from Database
Previous Resource: ASP.NET MVC Action filters
Return to Discussion Resource Index
Post New Resource
Category: ASP.NET/Web Applications


Post resources and earn money!
 
More Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use