?
Solved

how to generate an html table and add it into a panel.

Posted on 2007-11-26
2
Medium Priority
?
739 Views
Last Modified: 2008-02-01
hi experts,
i have a panel called pInci,

i'd like to add it a complete table generated by a controller with the method GetAlgo_Inci();
i wonder what 's the best maner? with literal controls or with htmltable?

this is how i'd like to add my new generated table.
pInci.Controls.Add(Controller_.GetAlgo_Inci());


how would be my method GetAlgo_Inci()? what do i have to return if i want to use
html controls in order to add the complete HtmlTable to Controls of my Panel ?

Class Controller
....
public .....  GetAlgo_Inci(){                   <-  what type to return,
 
    Table t = new Table();
    HtmlTableRow tr = new ...
    ...................                                      <- add tr to t?  
}


how you see what i need experts.
thanks in advance.
0
Comment
Question by:toshi_
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 4

Accepted Solution

by:
rallsaldo earned 1200 total points
ID: 20349725
Hi,

You could use System.Web.UI.WebControls and the return a Table object:

public Table GetAlgo_Inci()
{
        Table t = new Table();
        TableRow tr = new TableRow();
        TableCell tc = new TableCell();
        tr.Cells.Add(tc);
        t.Rows.Add(tr);
        return t;
}

Then you can add the returned table to your panel:

Table t = new Table();
t = Controller.GetAlgo_Inci();
MyPanel.Add(t)

I hope that helps,
R
0
 
LVL 7

Assisted Solution

by:nisarkhan
nisarkhan earned 300 total points
ID: 20349892
or the easiest  and  also easy to maintain option is:

public String GetAlgo_Inci()
{
        return "<table width='100%'><tr><td>something</tr></td>";
}
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question