Awesome Core and MVC Controls

AjaxList Client Side Api

    public class MealsApiDemoAjaxListController : Controller
    public ActionResult Search(int page, string meal, int? pageSize)
    pageSize = pageSize ?? 5;
    meal = (meal ?? "").ToLower();

    var list = Db.Meals.Where(o => o.Name.ToLower().Contains(meal));

    return Json(new AjaxListResult
    Items = list.Skip((page - 1) * pageSize.Value).Take(pageSize.Value).Select(o => new KeyContent(o.Id, o.Name)),
    More = list.Count() > page * pageSize.Value // bool - show More button or not


    We use cookies to improve your online experience. By accessing this site, you agree to the use of cookies and other technologies to process your personal data (e.g. IP address) to enhance and personalise your experience across our websites. Additionally, third-party companies, may store cookies on your device and use similar technologies to collect and use certain information. For more information, refer to our privacy policy and cookie policy.