Click here to Skip to main content
15,891,976 members
Articles / Web Development / HTML

Auto Complete Control Like in GMail/Hotmail/Facebook

Rate me:
Please Sign up or sign in to vote.
4.52/5 (8 votes)
1 Aug 2013CPOL1 min read 25.6K   962   18  
How to create an auto suggestion control like Gmail/Hotmail/Facebook to add items in list.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using NORTHWINDModel;

/// <summary>
/// Summary description for Controller
/// </summary>
public class Controller
{
	public Controller()
	{
		//
		// TODO: Add constructor logic here
		//
	}

    public List<string> Customer(string CustomerName)
    {
        List<string> Customerlist = new List<string>();
        using (NORTHWINDEntities Context = new  NORTHWINDEntities())
        {
            var Detail = (from Custm in Context.Customers where Custm.ContactName.StartsWith(CustomerName) select Custm.ContactName).ToList<string>();
            Customerlist = Detail;
        }
        return Customerlist;
    }

    
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
India India

Comments and Discussions