Solved

How To Create Table Control From HTML Text...?

Posted on 2012-03-20
5
217 Views
Last Modified: 2012-04-23
Is there a way to have a new Table control load a string that defines an HTML Table, that way I can manipulate the table in code, then re-write the HTML code out using the .RenderControl() method?

Here is my sample HTML string that I would want to load...
strHTMLCode = "<table style=""width: 100%;"">" &
              "    <tbody>" &
              "        <tr>" &
              "            <td colspan=""3"">Phone Call (Made) - 03/20/2012 [Ben]</td>" &
              "        </tr>" &
              "        <tr>" &
              "            <td style=""width: 50px;"">&nbsp;</td>" &
              "            <td style=""text-align: center; width: 20px; vertical-align: top;"">-</td>" &
              "            <td style=""width: 500px;"">Comment Goes Here</td>" &
              "        </tr>" &
              "    </tbody>" &
              "</table>"

Open in new window


...and I would like to do something like...
Dim objTable As New Table
objTable.LoadFromString(strHTMLCode)

Open in new window


Obviously I know there isnlt a LoadFromString() method on that object, but is there some equivalent to that type of process?
0
Comment
Question by:Ben Santiardo
  • 3
  • 2
5 Comments
 
LVL 19

Expert Comment

by:Manoj Patil
ID: 37743608
0
 
LVL 19

Expert Comment

by:Manoj Patil
ID: 37743642
0
 

Author Comment

by:Ben Santiardo
ID: 37748568
techChallenger1,

Thank you for the input, but that is not what I was looking for. I don't need to generate HTML code (I have the HTML code already), and I already know how to create dynamic tables server-side. What I need is to create a Server-Side object based on the HTML string representation of a table. Ultimately I wrote myself a custom class to handle what I need, but it's extremely limited and I know there may be scenarios where my code will not fuction properly because there are many variables I haven't accounted for.

If anyone knows of a better built-in way of getting what I need, please let me know!  :-)
0
 

Accepted Solution

by:
Ben Santiardo earned 0 total points
ID: 37861599
I never found an answer to this. Ended up building my own class to parse the HTML text.

Thanks for the input!
0
 

Author Closing Comment

by:Ben Santiardo
ID: 37879977
Found my own answer.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

735 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