Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > how to: Collect entire form's html code

Reply
Thread Tools

how to: Collect entire form's html code

 
 
Ryan McLean
Guest
Posts: n/a
 
      11-11-2003
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
 
Reply With Quote
 
 
 
 
Steve C. Orr [MVP, MCSD]
Guest
Posts: n/a
 
      11-11-2003
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) 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



 
Reply With Quote
 
 
 
 
SSW
Guest
Posts: n/a
 
      11-11-2003
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" <(E-Mail Removed)> wrote in message news:(E-Mail Removed) 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


 
Reply With Quote
 
Ryan McLean
Guest
Posts: n/a
 
      11-12-2003
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" <(E-Mail Removed)> wrote in message news:<(E-Mail Removed)>...
> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) 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

>
> --

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to set html encoding globally for entire solution? (ASP.NET 2.0) misiek ASP .Net 0 03-09-2006 10:59 AM
Getting access to a page's entire html source msnews.microsoft.com ASP .Net 2 04-03-2005 05:01 AM
Accessing entire Web Form HTML Source Shawn Berg ASP .Net 2 02-03-2005 09:30 PM
How to embed (show) an entire html page in asp.net Alex ASP .Net 4 10-28-2004 07:06 PM



Advertisments