public class HomeController : Controller { string commString = ""; public HomeController() { FWUtility.connString = "Data Source = DEVELOPER1; Initial Catalog = FR8DemoDB; uid=sa; pwd=123;"; } public ActionResult Index() { commString = "select BrandID, BrandName from BrandMaster order by BrandName"; List<BrandMaster> listBrandMaster = FWUtility.GetList<BrandMaster>(FWUtility.GetDataTable(commString)); var str = FWUtility.GetJson(listBrandMaster); return View(str); } } public class BrandMaster { public string BrandID { get; set; } public string BrandName { get; set; } } }
@using System.Data; @using JqeryUiAutoCompleteOnClickDisplayBrandIdOfBrandName.Controllers; @model string <script type="text/javascript"> $(document).ready(function () { myFunction(); }); function myFunction() { $.ajax({ url: "../Home/Index", dataType: 'json', $("#tags").autocomplete({}); }); } </script> <body> <div> <input id="tags"> </div> </body>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)