protected void Page_Load(object sender, EventArgs e) { string strPageNo = Request["PageNo"]; Int32.TryParse(strPageNo, out PageNo); if (PageNo == 0) { PageNo = 1; } if (!Page.IsPostBack) { BOLNews NewsBOL = new BOLNews(); rptNews.DataSource = NewsBOL.GetNews(PageNo, PageSize); rptNews.DataBind(); int ResultCount = NewsBOL.GetNewsCount(); int PageCount = (int)ResultCount / PageSize; if (ResultCount % PageSize > 0) { PageCount++; } ConcatUrl += ""; pgrToolbar.PageNo = PageNo; pgrToolbar.PageCount = PageCount; pgrToolbar.ConcatUrl = ConcatUrl; pgrToolbar.PageBind(); } }