User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 391,965 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,130 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting

App_Code and control

Join Date: Feb 2008
Location: Atlanta
Posts: 4
Reputation: gt1329a is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
gt1329a gt1329a is offline Offline
Newbie Poster

Re: App_Code and control

  #4  
Feb 4th, 2008
I'm assuming that's some code that's been moved from an ASPX page's code behind into its own class? It sounds like BlogTable was a control on that page.

If so, what you probably need to do is have RebuildBlogPage return a Table. Something like:

    Table RebuildBlogPage(DataSet ds)
    {
        //string prevUser = ""; //Etsitään edellinen user
        Table BlogTable = new Table();

        foreach (DataRow dr in ds.Tables[0].Rows)
        {            
            
            //Lisää topic
            TableRow tr = new TableRow();
            tr.Cells.Add(new TableCell());
            tr.Cells[0].CssClass = "h3";
            tr.Cells[0].Text = dr[0].ToString();
            
            BlogTable.Rows.Add(tr);            

            //Lisää date
            tr = new TableRow();
            tr.Cells.Add(new TableCell());
            tr.Cells[0].CssClass = "h5";
            tr.Cells[0].Text = Convert.ToString(dr[1].ToString()) + " by " +
                dr[3].ToString();
            BlogTable.Rows.Add(tr);          

            //Lisää BLog
            tr = new TableRow();
            tr.Cells.Add(new TableCell());
            tr.Cells[0].Width = 200;
            tr.Cells[0].CssClass = "textblog";
            tr.Cells[0].Text = dr[2].ToString();
            BlogTable.Rows.Add(tr);

            //lisätään separator
            tr = new TableRow();
            tr.Cells.Add(new TableCell());
            tr.Cells[0].ColumnSpan = 2;

            BlogTable.Rows.Add(tr);             
        }

        return BlogTable;
    }

Then, in your ASPX page, you would add the return value of that method to the controls collection of your page, placeholder, panel, or whatever you're using for layout.
Reply With Quote  
All times are GMT -4. The time now is 9:15 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC