You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.8 KiB

  1. using System.Collections.Specialized;
  2. namespace OT.Controls.DataPager
  3. {
  4. public partial class Pager
  5. {
  6. #region IPostBackEventHandler Implementation
  7. ///// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Method[@name="RaisePostBackEvent"]/*'/>
  8. public void RaisePostBackEvent(string args)
  9. {
  10. int pageIndex = CurrentPageIndex;
  11. try
  12. {
  13. if (string.IsNullOrEmpty(args))
  14. args = inputPageIndex;
  15. pageIndex = int.Parse(args);
  16. }
  17. catch { }
  18. PageChangingEventArgs pcArgs = new PageChangingEventArgs(pageIndex);
  19. if (cloneFrom != null)
  20. cloneFrom.OnPageChanging(pcArgs);
  21. else
  22. OnPageChanging(pcArgs);
  23. }
  24. #endregion
  25. #region IPostBackDataHandler Implementation
  26. ///// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Method[@name="LoadPostData"]/*'/>
  27. public virtual bool LoadPostData(string pkey, NameValueCollection pcol)
  28. {
  29. string str = pcol[UniqueID + "_input"];
  30. if (str != null && str.Trim().Length > 0)
  31. {
  32. try
  33. {
  34. int pindex = int.Parse(str);
  35. if (pindex > 0 && pindex <= PageCount)
  36. {
  37. inputPageIndex = str;
  38. Page.RegisterRequiresRaiseEvent(this);
  39. }
  40. }
  41. catch { }
  42. }
  43. return false;
  44. }
  45. ///// <include file='AspNetPagerDocs.xml' path='AspNetPagerDoc/Method[@name="RaisePostDataChangedEvent"]/*'/>
  46. public virtual void RaisePostDataChangedEvent() { }
  47. #endregion
  48. }
  49. }