Hi!
I have the following set up:
My paging now fails the 3rd time I click a page ( load the page, click another page, click yet another page = failure).
The failure results in being redirected to my site root.
Obviously it is something I have changed along the way since it worked a while ago and I have continued to modify my code since then and now it is broken.. classic scenario.
Anyway, I would greatly appreciate any pointers in which direction you think I should troubleshoot...
To add to my post...
I previously had my grid contained in a User Control but now have it directly on the page instead.This resulted in the following behaviour:
I can initialize my DataSource control in PageInit() and still have the same problem, or I can initialize my DataSource control in PageLoad and avoid the reported problem, but only the first page has any rows..(but I still get my correct number of pages)
And after further investigation, I have found that using a MasterPage is what causes my problems... which is very strange since it works fine on other pages in my projects...
I have even scaled down my master page to include nothing at all.
I'm tearing my hair over here.. any hints are welcome...
And now I got the solution from the support guys.
instead of: grid.DisplayLayout.Name = grid.ID;I need to do: grid.DisplayLayout.Name = grid.UniqueID;
Dunno why I did it in the first place, but it wrecked my paging.
Big hugs to the support for solving it!
Ok, after even further investigation I found that the pager renders bad links for me.
After clicking a page link in the pager control the igtbl_pageGrid() doesn't get the full gridcontrol id passed. When it should have been:
j***script:igtbl_pageGrid(event,'ctl00xMainContentxctrlGridxUltraWebGrid1',2)
it instead renders:
j***script:igtbl_pageGrid(event,'UltraWebGrid1',3)
And since that wont work the method returns null and the href is followed and I end up at the index of my site.
How can I control or help the pager to render the links correct? The strange part in this story is that it work in other parts of my site...