Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting HTML code of an ASPX page

Status
Not open for further replies.

grande

Programmer
Feb 14, 2005
657
CA
Hi guys,

Here's what I want to do, if possible.

When a user clicks a button, I want to get the HTML rendering of the ASPX page I'm on. (I need it to send an email, but I know how to do that)

So, does anyone know how to get the HTML out?

Thanks!

-------------------------
Call me barely Impressive Captain.
 
Make Body tag serverside:

Code:
<body id="objMainBody" runat="server">

Assuming its a C# code, define the object:

Code:
protected HtmlGenericControl objMainBody;

And when time comes, call:

Code:
string str = objMainBody.InnerHtml;

there should be a way to get OuterHtml, but dont seem to find it right now.

------------------
When you do it, do it right.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top