CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Language: C#

Asp.Net MVC && jQuery autocomplete

525 Views
Copy Code Show/Hide Line Numbers
   1:  using System;
   2:  using System.Collections.Generic;
   3:  using System.Linq;
   4:  using System.Web;
   5:  using System.Web.Mvc;
   6:  using Lucilla.Framework.Web.Mvc;
   7:  using DemoApp.Services.Model;
   8:   
   9:  namespace DemoApp.WebSite.Controllers
  10:  {
  11:      [Authorize]
  12:      public class SdkController : LucillaBaseController
  13:      {
  14:          private readonly ICustomerService _customerService;
  15:   
  16:          public SdkController(ICustomerService customerService)
  17:          {
  18:              _customerService = customerService;
  19:          }
  20:   
  21:          public JsonResult SearchCustomer(string term)
  22:          {
  23:              using(BusinessTransactionManager.CreateOrJoinCurrent())
  24:              {
  25:                  return Json(from c in _customerService.FindCustomers(term) select new
  26:                      {
  27:                          id = c.Id.CustSupp,
  28:                          value = c.CompanyName,
  29:                      }, JsonRequestBehavior.AllowGet);
  30:              }
  31:          }
  32:      }
  33:  }
by andreabalducci
  March 26, 2010 @ 4:31am
Tags:

Add a comment


Report Abuse
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate