i added mvcpager to my project but i need to add some parameter. it is paging in first stage
but when i clicked the pageindex , for example number of page 2 , this is return empty.there is no data and the paging is being cancelled
public ActionResult mainKaymak(string name = "",int id = 1)
{
var nameList = (Request.Form["name"]);
PagedList<pc> pcs=_entity.pcs.Where(c => c.name== nameList).OrderBy(o => o.name).ToPagedList(id, 5);
return PartialView("mainArea",pcs);
for example i enter my name "serhat" from inputbox (Request.Form["name"])
when name is serhat total record 13 and it is paging prev 1 2 next .it is ok.
PagedList<pc> pcs=_entity.pcs.Where(c => c.name== name ).OrderBy(o => o.name).ToPagedList(id, 5);
if pageindex is 2 or 1, all the rocords are listing. it is not going on that name is serhat
prev 1 2 3 4 5 6 next
serhatergun
Member
67 Points
120 Posts
Webdiyer MvcPager add parameter
Jan 25, 2013 08:47 PM|LINK
http://en.webdiyer.com/MvcPager/Demo/MsAjaxOrders
i added mvcpager to my project but i need to add some parameter. it is paging in first stage
but when i clicked the pageindex , for example number of page 2 , this is return empty.there is no data and the paging is being cancelled
public ActionResult mainKaymak(string name = "",int id = 1)
{
var nameList = (Request.Form["name"]);
PagedList<pc> pcs=_entity.pcs.Where(c => c.name== nameList).OrderBy(o => o.name).ToPagedList(id, 5);
return PartialView("mainArea",pcs);
}
ignatandrei
All-Star
135184 Points
21682 Posts
Moderator
MVP
Re: Webdiyer MvcPager add parameter
Jan 26, 2013 07:46 AM|LINK
1. if you have string name, it does not require namelist.
2. Your example on the page works.
serhatergun
Member
67 Points
120 Posts
Re: Webdiyer MvcPager add parameter
Jan 26, 2013 10:53 AM|LINK
it is paging in first stage prev 1 2 3 4 next
but when i click 1 it is not displaying any records.
public ActionResult mainKs(string name = "",int id = 1) {
//var nameList = (Request.Form["name"]);
PagedList<pc> pcs=_entity.pcs.Where(c => c.name== name ).OrderBy(o => o.name).ToPagedList(id, 5);
return PartialView("mainArea",pcs);
}
serhatergun
Member
67 Points
120 Posts
Re: Webdiyer MvcPager add parameter
Jan 26, 2013 11:11 AM|LINK
total records is 28 and prev 1 2 3 4 5 6 next
name = (Request.Form["name"]);
for example i enter my name "serhat" from inputbox (Request.Form["name"])
when name is serhat total record 13 and it is paging prev 1 2 next .it is ok.
PagedList<pc> pcs=_entity.pcs.Where(c => c.name== name ).OrderBy(o => o.name).ToPagedList(id, 5);
if pageindex is 2 or 1, all the rocords are listing. it is not going on that name is serhat
prev 1 2 3 4 5 6 next
mgasparel
Member
298 Points
65 Posts
Re: Webdiyer MvcPager add parameter
Jan 27, 2013 04:19 AM|LINK
I'm guessing your paging links are not passing the form value along. Maybe you could append it to the URL with some javascript?
TaoYang
Member
42 Points
20 Posts
Re: Webdiyer MvcPager add parameter
Jan 27, 2013 02:03 PM|LINK
Please post your MvcPager code in aspx page, set break point to your action and debug, check if id value received is correct.
thanks