Solved

Want to return a System.Web.UI.WebControls.Table as HTML to be sent in the body of an HTML email

Posted on 2008-10-05
2
2,245 Views
Last Modified: 2012-05-05
Hi

i am writing a basket on several pages using a panel in the aspx and a sub that builds/populates the table and adds it to the panel. this is fine.
i now need to send the same table in an HTML email, but want to use the same method.

ive tried returning the table as a string, but this just produces 'System.Web.UI.WebControls.Table'

any ideas?
0
Comment
Question by:glumlun
2 Comments
 
LVL 16

Accepted Solution

by:
anoyes earned 500 total points
ID: 22645554
You can use the RenderControl method of the table to write the contents to HTML.

Dim sb As New System.Text.StringBuilder

Dim ht As New System.Web.UI.HtmlTextWriter(New System.IO.StringWriter(sb))

table.RenderControl(ht)

Dim html As String = ht.InnerWriter.ToString

Open in new window

0
 
LVL 11

Author Closing Comment

by:glumlun
ID: 31503180
thankyou very much, perfect sollution
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

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

11 Experts available now in Live!

Get 1:1 Help Now