Capturing ASPX output from another page

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Capturing ASPX output from another page

    I often have the need to run templates that perform the equivalent of a mail
    merge as part of the processing for another page. For example, I have an
    invoice display page in my admin module and hten need to send a prepared
    message (such as a declined order email) to the invoicee, which consists of
    a merge letter.

    Server.Transfer() doesn't do the trick, as it leaves the current page and
    doesn't return. I could do this but this is quite a hassle to do as you have
    to pass state back and forth across pages.

    I know I can capture output from the current page by overriding the Render()
    method of the page and that works for many things as long as the content to
    merge is the same as the current page (works well for things like Invoice
    Confirmations)... but is there anyway to cause another page to be
    instantiated and be rendered via code (ie. without calling the ASPX file??
    I've tried to do this by instantiating the class, but it would seem that the
    HTTP runtime needs to know more info in order to render or even fire the
    code in the form...

    Any ideas on how to accomplish this?


    +++ Rick ---


    --

    Rick Strahl
    West Wind Technologies
    [url]http://www.west-wind.com/[/url]
    [url]http://www.west-wind.com/wwHelp[/url]
    ----------------------------------
    Making waves on the Web




    Rick Strahl [MVP] Guest

  2. Similar Questions and Discussions

    1. capturing control output
      To produce 1 dynamic chart, I add a control to my aspx page positioned in a placeholder. I need to have more than one chart and need to capture...
    2. Accessing a aspx page using HttpWebRequest from another aspx page on the same webapp
      Did you have any luck on this as I have the same problem. Maybe you can help me out of you solved your problem.
    3. capturing output of a shell comand
      Hi everyone.... I have been trying to capture the output of a shell command (say ls or echo *) in a variable but all i have been able to capture is...
    4. [PHP] Capturing script output
      Joel Konkle-Parker <mailto:jjk3@msstate.edu> on Thursday, August 21, 2003 9:17 AM said: 1. Remove the buffering calls that are within the...
    5. Capturing script output
      I've got somewhat of a methodology question here. I've got a YaBBSE message board <http://yabbse.org> that I'm trying to integrate into my site...
  3. #2

    Default Re: Capturing ASPX output from another page

    You can use the WebRequest object to call your web page, then you can
    capture the HTML that it output.

    Here's a nice example:
    [url]http://www.digitalvideotoolbox.com/Modules/AspFaq/ShowQuestion.aspx?QID=88[/url]

    --
    I hope this helps,
    Steve C. Orr, MCSD
    [url]http://Steve.Orr.net[/url]


    "Rick Strahl [MVP]" <rickstrahl@hotmail.com> wrote in message
    news:%23l3rxqkRDHA.2480@tk2msftngp13.phx.gbl...
    > I often have the need to run templates that perform the equivalent of a
    mail
    > merge as part of the processing for another page. For example, I have an
    > invoice display page in my admin module and hten need to send a prepared
    > message (such as a declined order email) to the invoicee, which consists
    of
    > a merge letter.
    >
    > Server.Transfer() doesn't do the trick, as it leaves the current page and
    > doesn't return. I could do this but this is quite a hassle to do as you
    have
    > to pass state back and forth across pages.
    >
    > I know I can capture output from the current page by overriding the
    Render()
    > method of the page and that works for many things as long as the content
    to
    > merge is the same as the current page (works well for things like Invoice
    > Confirmations)... but is there anyway to cause another page to be
    > instantiated and be rendered via code (ie. without calling the ASPX file??
    > I've tried to do this by instantiating the class, but it would seem that
    the
    > HTTP runtime needs to know more info in order to render or even fire the
    > code in the form...
    >
    > Any ideas on how to accomplish this?
    >
    >
    > +++ Rick ---
    >
    >
    > --
    >
    > Rick Strahl
    > West Wind Technologies
    > [url]http://www.west-wind.com/[/url]
    > [url]http://www.west-wind.com/wwHelp[/url]
    > ----------------------------------
    > Making waves on the Web
    >
    >
    >
    >

    Steve C. Orr, MCSD Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139