By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,495 Members | 1,252 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,495 IT Pros & Developers. It's quick & easy.

how to: Collect entire form's html code

P: n/a
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
Nov 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
You can email a page to somebody using the WebRequest and MailMessage
classes for this functionality.
Here are a couple examples:

http://www.aspalliance.com/stevesmit...ailwebsite.asp

http://aspnet.4guysfromrolla.com/articles/091102-1.aspx

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com

"Ryan McLean" <Ry*********@NAU.EDU> wrote in message
news:6e**************************@posting.google.c om...
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

Nov 17 '05 #2

P: n/a
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
"Ryan McLean" <Ry*********@NAU.EDU> wrote in message news:6e**************************@posting.google.c om...
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


Nov 17 '05 #3

P: n/a
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

"SSW" <fr************@hotmail.com> wrote in message news:<uG**************@TK2MSFTNGP11.phx.gbl>...
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
"Ryan McLean" <Ry*********@NAU.EDU> wrote in message
news:6e**************************@posting.google.c om...
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


--

Nov 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.