public JsonResult LoadingItemsWithPaging(ListBoxLoadingItemsEventArgs args)
{
ListBoxItemList items = GetFilteredCustomers(args.Text, args.ItemsOffset);
int itemsCount = GetFilteredCustomersCount(args.Text);
int itemsLoadedCount = args.ItemsOffset + items.Count();
JsonResult result = new JsonResult
{
Data = new
{
Items = items,
ItemsCount = itemsCount,
ItemsLoadedCount = itemsLoadedCount
},
JsonRequestBehavior = JsonRequestBehavior.AllowGet
};
return result;
}