ITORIAN    

  public string Welcome() {

      return "Abhimanyu's Thoughts";

  }

My First E-Book
Quick Report
Yearly Posts:
   i) Oct-Nov 2010: 12
   ii) In 2011: 380
   iii) In 2012: 32

You can find my articles and blogs on:
   i) itorian.com
   ii) c-sharpcorner.com
   iii) dotnetfunda.com
   iv) codeproject.com

Greatest Hits
People I Follow
Disclaimer
This is my personal website and the opinions I have expressed here is my own. For any accuracy I recommend to visit official websites like MSDN for Microsoft. I developed this website to share my technical skills.

AutoComplete-Auto Listing (frequently used items in TextBox) in ASP.NET
In this post you will learn how to deal with AutoComplete in ASP.NET.
Abhimanyu Kumar Vatsa

IT Faculty || I blog on Microsoft Technologies || Mindcracker MVP || Founder of ITORIAN.COM
   

Introduction

Look at the image given below:

In the above image, you can see there are recently and frequently used numbers are listed when I placed the cursor in the TextBox to type something it comes up. Actually it happens by default and to stop this we need to add special attribute to existing system.

In ASP.NET to deal or say top such default system we need to use AutoCompete property of TextBox.

We can use AutoComplete property in HTML page as well as code-behind.

From HTML Page

To turn-off the AutoComplete for any TextBox from HTML Page, we need to use following:

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

OR

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

OR

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

From Code-Behind

To turn-off the AutoComplete for any TextBox from code-behind, we need to use following:

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

So, that’s all about the AutoComplete in ASP.NET.


Happy Coding !!



Join us on Facebook. Join us on Twitter.

   



Approved Comments

No any comment found.