473,385 Members | 2,029 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

how to: Collect entire form's html code

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
3 1408
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Phillip Wu | last post by:
Hi, I saw a previous post about sending arrays but did not quite understand the answers. The problem is that I would like to pass an entire array as a hidden input field from one php script...
2
by: Eric Cadwell | last post by:
Does anyone know of any case in which the CLR explicitly calls GC.Collect? I have a form that when unloaded, shows # of induced GC's incremented by 5. This is killing performance. I have a...
5
by: Mrinal Kamboj | last post by:
Hi , Any pointers when it's absolute necessary to use it . Does it has a blocking effect on the code , as GC per se is undeterministic . what if GC.collect is followed in next line by...
3
by: David | last post by:
My goal is to collect all the textboxes on a given page in code (or all checkboxes). The only way that I know how is traversing through the hierarchy and collect them Page |__Controls...
7
by: Martin | last post by:
Hi, I have a standard aspx page (form) that contains a few user controls. Upon form submission the page is validated. If validation passses then a text based email is sent. This is all working...
4
by: c676228 | last post by:
Hi everyone, I need to write a insruance program which needs to collect multiple people information, The information for each person includes name, email, address, phone, dob etc. The DOB data...
0
by: peter stickney | last post by:
Excuse the babbling or lack of sense, it's been a long day. I am making a flat file, static HTML search engine for a site. I downloaded a script from the net and have been working with it for my...
9
by: anon.asdf | last post by:
In terms of efficieny: Is it better to use multiple putchar()'s after one another as one gets to new char's OR is it better to collect the characters to a char-array first, and then use...
4
by: fjm | last post by:
Hello eveyone Is there a way to email an entire html page after the page is processed for data? What I have is an entire html page that draws data from a db. I would like to email that form...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.