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,360 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

691 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