예제 #1
0
 /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Method[@name="RaisePostBackEvent"]/*'/>
 public void RaisePostBackEvent(string args)
 {
     int pageIndex = CurrentPageIndex;
     try
     {
         if (string.IsNullOrEmpty(args))
             args = inputPageIndex;
         pageIndex = int.Parse(args);
     }
     catch { }
     PageChangingEventArgs pcArgs = new PageChangingEventArgs(pageIndex);
     if (cloneFrom != null)
         cloneFrom.OnPageChanging(pcArgs);
     else
         OnPageChanging(pcArgs);
 }
예제 #2
0
 /// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Method[@name="OnPageChanging"]/*'/>
 protected virtual void OnPageChanging(PageChangingEventArgs e)
 {
     //pageChangeEventHandled = true;
     PageChangingEventHandler handler = (PageChangingEventHandler)Events[EventPageChanging];
     if (handler != null)
     {
         handler(this, e);
         if (!e.Cancel || UrlPaging) //there's no way we can obtain the last value of the CurrentPageIndex in UrlPaging mode, so it doesn't make sense to cancel PageChanging event in UrlPaging mode
         {
             CurrentPageIndex = e.NewPageIndex;
             OnPageChanged(EventArgs.Empty);
         }
     }
     else
     {
         CurrentPageIndex = e.NewPageIndex;
         OnPageChanged(EventArgs.Empty);
     }
     //pageChangeEventHandled = false;
 }