From: Jaben C. <ja...@us...> - 2007-03-20 09:56:56
|
Update of /cvsroot/yafdotnet/yafsrc/pages In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv30765/yafsrc/pages Modified Files: Tag: v1_0_2_NETv2 topics.ascx.cs Log Message: modifications... improved pagination added pagination for topics. Index: topics.ascx.cs =================================================================== RCS file: /cvsroot/yafdotnet/yafsrc/pages/topics.ascx.cs,v retrieving revision 1.24.2.6 retrieving revision 1.24.2.7 diff -C2 -d -r1.24.2.6 -r1.24.2.7 *** topics.ascx.cs 13 Sep 2006 11:24:17 -0000 1.24.2.6 --- topics.ascx.cs 20 Mar 2007 09:56:55 -0000 1.24.2.7 *************** *** 41,44 **** --- 41,45 ---- private DataRow forum; protected int ShowTopicListSelected; + private bool m_bIgnoreQueryString = false; /// <summary> *************** *** 184,187 **** --- 185,189 ---- private void Pager_PageChange( object sender, EventArgs e ) { + m_bIgnoreQueryString = true; SmartScroller1.Reset(); BindData(); *************** *** 215,218 **** --- 217,231 ---- int nPageSize = System.Math.Max( 5, Pager.PageSize - dt.Rows.Count ); Announcements.DataSource = dt; + + if ( !m_bIgnoreQueryString && Request.QueryString ["p"] != null ) + { + // show specific page (p is 1 based) + int tPage = Convert.ToInt32( Request.QueryString ["p"] ); + + if ( tPage > 0 ) + { + Pager.CurrentPageIndex = tPage - 1; + } + } int nCurrentPageIndex = Pager.CurrentPageIndex; |