ASP.NET MVC and Paging - Search & Result Scenario
Posted
by devforall
on Stack Overflow
See other posts from Stack Overflow
or by devforall
Published on 2008-12-15T16:39:02Z
Indexed on
2010/06/17
19:13 UTC
Read the original article
Hit count: 208
asp.net-mvc
|paging
I have forms in my page a get and a post and i want add pager on my get form .. so i cant page through the results..
The problem that i am having is when i move to the second page it does not display anything..
I am using this library for paging .. http://stephenwalther.com/Blog/archive/2008/09/18/asp-net-mvc-tip-44-create-a-pager-html-helper.aspx
this my actions code.
[AcceptVerbs("GET")]
public ActionResult SearchByAttraction()
{
return View();
}
[AcceptVerbs("POST")]
public ActionResult SearchByAttraction(int? id, FormCollection form)
{....
}
and this is what i am using on my get form to page through
<%= Html.Pager(ViewData.Model)%> //but when i do this it goes to this method [AcceptVerbs("GET")] public ActionResult SearchByAttraction()
instead of going to this this
[AcceptVerbs("POST")] public ActionResult SearchByAttraction(int? id, FormCollection form)
which sort of makes sence .. but i cant really think of any other way of doing this
Any help would be very appreciated..
Thanx
© Stack Overflow or respective owner