Click here to Skip to main content
15,888,315 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
heyy..


I am using autocomplete in my project , autocomplete text is coming ,but its value does not..

here is my code in view:

$(document).ready(function () {
var searchtext = $("#txtStockName");
searchtext.autocomplete({
source: '/OpeningStock/SerachStockText'

});
});


In my Controller :

C#
public JsonResult SerachStockText(string term)
     {


         var movies = dbContext.ImsStockItem.Where(x => x.StockName.StartsWith(term)).Select(r => new { label = r.StockName,value=r.StockId });
         return Json(movies, JsonRequestBehavior.AllowGet);

     }



while selecting the text the id is shown..
Posted

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900