Solved

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

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to deploy to IIS 7 on 2008R2 server with DUO 2-step login? 2 51
Split in Javascript 5 39
SQL Exceptions 3 43
EF5: Question about Metadata Artifact Processing 4 15
Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

776 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