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,277 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

806 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