Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
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
Medium Priority
?
2,449 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 2000 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…
Suggested Courses

618 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