Work with JSONresult and ViewBag togetherHello.
I am working on 1 page where I need to bind the data in table format.
I done with it. Below the table / grid, I have buttons "Next" and "Previous.
Here, I am binding data through JSONResult. I am passing list through it to View.
In the same method, I have declared one ViewBag variable.
ViewBag.CurrentPageIndex = 1;
ViewBag.LastPageIndex = 2;
objList = objSelfService.GetData(FirstPageIndex, PageSize);
return Json(objList, JsonRequestBehavior.AllowGet);
Here, In view, I am not able to get the value of ViewBag.
I think, it may be because of JSONResult i am using.
How can I pass or access ViewBag value in View using JSONResult along with my list.