I have an Asp.Net page containing one GridView and a couple of images (google charts - pngs).
I need to email the contents of my page. How can I do that? The grid can be an html table in the email body or the whole thing could be an image; it doesn't matter.
Thanks for your help!
views:
112answers:
2
+2
A:
You can use a library that converts an URL into a single MHT file (that embeds images, stylesheets, etc.) and attach that file with your e-mail.
Here's a .NET library that does the job (and it's written by Jeff Atwood ^^)
Olivier PAYEN
2009-07-06 07:31:10
Thanks Olivier! I will investigate your suggestion asap.
Gustavo Cavalcanti
2009-07-06 15:36:56
A:
In the past I've used GridView.RenderControl to render a gridview out to a file outside of ASP.NET (in a console application). This might be worth investigating.
Edit- I've managed to find a blog post with someone using this technique- this may help you.
Whether this will work for the images depends on what you are doing to generate them. Presumably they are dynamically generated, perhaps using an HttpHandler, or are they generated from controls?
RichardOD
2009-07-06 07:36:44
Hi Richard, thanks for your answer. Fortunately in my case, I have the URLs of the images, as they are google charts images. I think the hardest part would be the grid. I will investigate your suggestion. Thanks again!
Gustavo Cavalcanti
2009-07-06 15:36:24
Although Olivier's answer is also correct, Richard's is way simpler and does the job much cleanly. Thanks!
Gustavo Cavalcanti
2009-07-09 06:26:52