how to: Collect entire form's html code

R

Ryan McLean

Hello everyone!

What I am trying to accomplish is as follows: I have a .aspx page
where I display the user's information. This consists of a datagrid,
several labels, etc. I would like to send this same information in
the body of an email. Now, I know I could simply rewrite the contents
into an html string thingy and just put stuff like
strMailBody="<html><body><table><tr><td>First name:</td><td>" &
Me.txtFirstName.Text & " . . . and so forth, but I am trying to figure
out if there is a way to grab information that is printed onto the
screen. I have looked into readHtmlPage, is there any other way I
might accomplish this. I am hoping that I could just put everything
that I need into an asp:tablecell and capture everything that way. As
you probably know this failed miserably.

Any ideas?

Thanks in advance!

Ryan
 
S

SSW

Hi Ryan,

U Can use Server.Execute. Using this u get string writer with HTNL Code. Which u can send it via Email in HTML format.

Below is the sample code which grap HTML Code and Display it user.
---------------------------------------------------------------------------------------------------------------------------------------
Code for HTML Graber
---------------------------------------------------------------------------------------------------------------------------------------
writer StringWriter = new StringWriter();
Server.Execute("UrAspPage.aspx", writer);
Response.Write("<H3>Ur Page will be: </H3><br>" & writer.ToString());
---------------------------------------------------------------------------------------------------------------------------------------
Code End
---------------------------------------------------------------------------------------------------------------------------------------

Hope this helps.

Thanks,

sswalia
MCSD, MCAD, OCA
 
R

Ryan McLean

You are both awesome! Thank for the fast responses!

I'm sure one of these suggestions will be perfect. Now for the research . . .

Thanks again and have a great week!

Ryan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top