I am working on a page with several dynamically generated tables where the original developers used approximately the following logic:
<table>
<tr>...</tr>
<asp:PlaceHolder ID="ph1" runat="server" />
</table>
In the code behind:
// Do lots of stuff
HtmlTableCell cell = new HtmlTableCell();
// set cell text, formatting, etc
ph1.Controls.Add(cell);
// repeat the above logic for every cell in the table
In one page, methods like this are used to add up to 10-15 total rows, with 10-15 columns each spread over 4-5 tables. The table structures are set, so this could also be constructed by hard-coding the table structure in html and putting literals and labels in each cell. The page itself has some performance issues. This is one of the factors that could be contributing to the bad performance.
The question is:
If they are they must be so marginal that you wouldnt notice. Ive coded a gridviewish control in this way with 10x50 cells and had no noticeable performance issues compared to static tables in similar size.
What you should strive for in most cases is maintainability :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With