开发者

Dynamic Data Web Application not paging past page 2

I have created a Dynamic Data Web Application and when I have more then one page I am able to navigate to the second page and the last page however I开发者_如何学Go am unable to navigate to any of the pages in between two and the last page....any ideas or suggestions?


I encountered the same problem, and in my case, it was caused by broken filters.

I created a Textbox filter, and during development, I unwittingly added OnFilterChanged(); in the FilterControl's Page_Load event for the sake of simplicity. Later, it was rendered obsolete as I copied it into the TextChanged event, as the former method has glitches.

Unfortunately, in List.aspx.cs, there lies the following code:

protected void DynamicFilter_FilterChanged(object sender, EventArgs e)
{
    GridView1.PageIndex = 0;
}

As a result, at every page load, the PageIndex of GridView is reset. And since Page_Load is called before DynamicFilter_FilterChanged before the next page button's event handler, the result will be:

On any list page with more than one page:

  • Clicking next whatever the current PageIndex navigates to page 2
  • Clicking previous whatever the current PageIndex navigates to page 1
  • Other navigation controls work as intended, including entering the page number.

To solve the problem, I just removed OnFilterChanged(); from Page_Load in the filter.

You may need to check every third-party filter. Or, you may comment out the DynamicFilter_FilterChanged event to see if filters are to blame.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜