i have an issue with logic in ASP.NET web site – (gridview – filter – paging)
filter component
——-
gridview component
——-
paging component
——-
Question:
Full list of result shows ‘1 of 25 pages’ on first load.
If I choose filter by some condition – it shows result ‘1 of 5 pages’.
And if i use paging (to go to 5 (last) page) – filter is crashed and shows 5 of 25 pages.
How to implement right logic for FILTER with PAGING in gridview?
With regards!
The problem is, that the pager generates HTTP GET links with jsut the page as parameter, so your form values are all lost.
You can solve it like this article proposes with intercepting the click on the link with jquery and submitting the form instead.
Or you can solve it simply by changing the method of your search form to
GET. The pager just appends thepageparameter to the current url, so your filter parameters will be send back to the action in that case. This approach is shown in detail in this article.