Solved

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

Posted on 2012-03-20
5
213 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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

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…
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

743 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now