Language: C#
Asp.Net MVC && jQuery autocomplete
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: }
Tags:
Report Abuse
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search

