#
cdigs
The pager control doesn't seem to be working properly. I first encountered the error with a custom module that I was writing but I've now noticed that it doens't work properly with the existing Articles module either.
I'll debug through it and see if I can come up with the solution...
[Edit 1] Quick step through, it seems that the ControlToPage_DataBinding event handler is not hooking up properly...
[Edit 2] Because you are not calling DataBind() on the postback, the event is not being fired since it's hooked onto the DataBinding event hook?
[Edit 3] Okay, I figured it out. In the OnInit method of the Pager control, I added the following line right below this._controlToPage.DataBinding += new EventHandler(ControlToPage_DataBinding); :
this.PageChanged += new PageChangedEventHandler(Pager_PageChanged);
I added a new event handler method like so:
private void Pager_PageChanged(object sender, PageChangedEventArgs e) {
this.UpdateView();
}
I pulled out the contents of ControlToPage_DataBinding() into a new method UpdateView() and changed ControlToPage_DataBinding() to simply call UpdateView().
[Edit 4] Note that this fix only works if the caching is set to true.
I'll debug through it and see if I can come up with the solution...
[Edit 1] Quick step through, it seems that the ControlToPage_DataBinding event handler is not hooking up properly...
[Edit 2] Because you are not calling DataBind() on the postback, the event is not being fired since it's hooked onto the DataBinding event hook?
[Edit 3] Okay, I figured it out. In the OnInit method of the Pager control, I added the following line right below this._controlToPage.DataBinding += new EventHandler(ControlToPage_DataBinding); :
this.PageChanged += new PageChangedEventHandler(Pager_PageChanged);
I added a new event handler method like so:
private void Pager_PageChanged(object sender, PageChangedEventArgs e) {
this.UpdateView();
}
I pulled out the contents of ControlToPage_DataBinding() into a new method UpdateView() and changed ControlToPage_DataBinding() to simply call UpdateView().
[Edit 4] Note that this fix only works if the caching is set to true.