using System; namespace yaf { /// /// Summary description for Header. /// public class Header : BaseControl { private string m_html = ""; private bool m_rendered = false; /// /// Status information about the header class. /// public string Info { set { m_html = value; if ( m_rendered ) throw new ApplicationException( "Header already rendered." ); } } /// /// Renders the header. /// /// The HtmlTextWriter that we are using. protected override void Render( System.Web.UI.HtmlTextWriter writer ) { writer.Write( m_html ); m_rendered = true; } } /// /// Class test. /// public class Test : BaseControl { /// /// The default constructor for Test. /// public Test() { } /// /// Renders the Test class. /// /// protected override void Render( System.Web.UI.HtmlTextWriter writer ) { string act_rank = ""; act_rank += ""; act_rank += ""; //act_rank += ""; //act_rank += ""; System.Data.DataTable rank = DB.user_activity_rank(); int i = 1; act_rank += ""; act_rank += "
Most active users
UserPosts
"; foreach ( System.Data.DataRow r in rank.Rows ) { string img = ""; // string.Format( "", MyPage.ThemeFile( string.Format( "user_rank{0}.gif", i ) ) ); i++; act_rank += ""; // Immagine act_rank += string.Format( "", img ); // Nome autore act_rank += string.Format( "", r ["Name"], Forum.GetLink( Pages.profile, "u={0}", r ["ID"] ) ); // Numero post act_rank += string.Format( "", r ["NumOfPosts"] ); act_rank += ""; } act_rank += "
{0} {0}{0}
"; writer.Write( act_rank ); } } }