Link to home
Start Free TrialLog in
Avatar of slugovsky
slugovsky

asked on

How can I extract raw HTML from dynamic server controls in ASP.NET?

Hello all,

     Does anyone know of a way to "extract" the HTML from dynamically created controls in ASP.NET (VB) and save it to a string variable? Here is what I'm trying to do: Ive got a very nicely designed Database driven table that is adding cells and rows to the table control per iteration of DbRow. When the user clicks a button, I am going to send them an HTML-based email of that table with all of the formatting, etc.  Instead of *rebuilding* the table piece by piece into an html string, is there a way just to extract the raw HTML with all of the formatting so that I can include it into a message body?  Something like : TableControl.ToHTML(), if it existed?  The good news is: all of the table cells just contain dynamic labels and data.  Nothing funky. No dropdowns, no textboxes, nada.  Hopefully this makes sense. :)

Any help is appreciated!

SOLUTION
Avatar of NazoUK
NazoUK
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of Carl Tawn
Carl Tawn
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of slugovsky
slugovsky

ASKER

This worked famously! Thank you so much!