Author: Ry99 | Posted on: 8/28/2008 3:38:16 PM | Views : 319

I am running into the problem that I am creating HTML dynamically for several areas of my project and end up doing this in all the wrong way it seems like.  For example, I have a table that needs to be created dynamically, I then need to add this table to the page several times (but how many times is unknown until runtime).  I have been doing this by using Literals and inserting the HTML directly into that, but the code looks really sloppy and brings a lot of HTML/Presentation into my code.  For Example:

Public Sub insertTable(ByRef myObj As myObject)
    myHTMLStr = "<table><tr><td>title</td></tr>" _
    + "<tr><td>content, blah blah " + myObj.myProperty + "</td></tr>" _
    + "</table>"
    myLiteral.Text += myHTMLStr
End Sub
I'm basically doing it like that ...

Go to the complete details ...