how to: Collect entire form's html code

Discussion in 'ASP .Net' started by Ryan McLean, Nov 11, 2003.

  1. Ryan McLean

    Ryan McLean Guest

    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
    Ryan McLean, Nov 11, 2003
    #1
    1. Advertising

  2. 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/stevesmith/articles/dotnetemailwebsite.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" <> wrote in message
    news:...
    > 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
    Steve C. Orr [MVP, MCSD], Nov 11, 2003
    #2
    1. Advertising

  3. Ryan McLean

    SSW Guest

    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" <> wrote in message news:...
    > 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
    SSW, Nov 11, 2003
    #3
  4. Ryan McLean

    Ryan McLean Guest

    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" <> wrote in message news:<>...
    > 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" <> wrote in message
    > news:...
    > > 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

    >
    > --
    Ryan McLean, Nov 12, 2003
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Shawn Berg

    Accessing entire Web Form HTML Source

    Shawn Berg, Feb 3, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    383
    Shawn Berg
    Feb 3, 2005
  2. Chris
    Replies:
    4
    Views:
    10,174
    Chris
    Feb 3, 2006
  3. Chris Cairns

    Collect string from HTTP Form POST

    Chris Cairns, Jul 10, 2003, in forum: ASP General
    Replies:
    2
    Views:
    148
    Mark Schupp
    Jul 10, 2003
  4. c676228
    Replies:
    3
    Views:
    112
    ChigbuaUmuenu
    Oct 7, 2006
  5. Son KwonNam

    copying entire form objects to another form??

    Son KwonNam, Jan 11, 2006, in forum: Javascript
    Replies:
    3
    Views:
    138
Loading...

Share This Page