Advertisement
klimentmichal

Autocomplete

May 19th, 2016
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.32 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.Services;
  6.  
  7. namespace aspnet4MichalKliment
  8. {
  9.     [WebService(Namespace = "http://tempuri.org/")]
  10.     [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
  11.     [System.ComponentModel.ToolboxItem(false)]
  12.     // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
  13.      [System.Web.Script.Services.ScriptService]
  14.     public class WebService1 : System.Web.Services.WebService
  15.     {
  16.  
  17.         [WebMethod]
  18.         [System.Web.Script.Services.ScriptMethod]
  19.         public List<string> GetCities(string prefixText, int count)
  20.         {
  21.             return (from r in StaticLibrary.Cities where r.StartsWith(prefixText, StringComparison.CurrentCultureIgnoreCase) select r).Take(count).ToList();
  22.         }
  23.         //[WebMethod]
  24.         //[System.Web.Script.Services.ScriptMethod]
  25.         //public string[] GetCompletionList(string prefixText, int count, string contextKey)
  26.         //{
  27.         //    //List<String> Return = SearchList.GetSearchList(HttpContext.Current.Session["sTown"].ToString());
  28.  
  29.         //    return (from r in StaticLibrary.Cities where r.StartsWith(prefixText, StringComparison.CurrentCultureIgnoreCase) select r).Take(count).ToArray();
  30.         //}
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement