In a previous 4Guys article, Emailing the Rendered Output of an
ASP.NET Web Control, I showed how to programmatically render the HTML of an ASP.NET Web control (such as a GridView)
and then send that HTML through email. This technique is useful in scenarios where you want to let the user email themselves
the web page, or portions of the page. For example, in a typical eCommerce website, after completing an order the user is taken
to an order summary page that would likely include a Web control that lists the items purchased, the applicable tax, and
the total due. You could include a button on this page that, when clicked, emails the user this information.
While the code presented in Emailing the Rendered Output of an ASP.NET Web Control and its follow-up article,
Enhancing the 'Email the Rendered Output of an ASP.NET Web Control' Code,
works great in ASP.NET version 1.x, the same code results in an exception
in ASP.NET 2.0. In this article we will look at why this exception occurs
and how to circumvent it, exploring examples in both VB and C#. Read on to learn more!
Read More >