how to execute and capture .aspx output

Discussion in 'ASP .Net' started by John Mott, Jan 11, 2006.

  1. John Mott

    John Mott Guest

    Is there a way for a web form to invoke an .aspx page and get its output
    using the framework? I suppose i can create a client app and execute the url
    but I'm thinking there must be a way to do it with the framework.

    thanks,

    john
     
    John Mott, Jan 11, 2006
    #1
    1. Advertising

  2. Yes, you can use the WebResponse and WebRequest classes in the framework to
    request the ASPX page and then capture the HTML output from the Response's
    output stream. I don't have the code in front of me, but I can dig it up if
    you need it.

    Paul


    "John Mott" wrote:

    > Is there a way for a web form to invoke an .aspx page and get its output
    > using the framework? I suppose i can create a client app and execute the url
    > but I'm thinking there must be a way to do it with the framework.
    >
    > thanks,
    >
    > john
    >
    >
    >
     
    =?Utf-8?B?SGF2YWdhbg==?=, Jan 11, 2006
    #2
    1. Advertising

  3. Dim webReq as WebRequest
    Dim webResp as WebResponse
    Dim srResp as StreamReader

    webReq = webReq.Create("http://some.url.com/somepage.aspx")
    webResp = webReq.GetResponse()
    srResp = New StreamReader(webResp.GetResponseStream())

    Dim htmlOutput as String = srResp.ReadToEnd()



    "John Mott" wrote:

    > Is there a way for a web form to invoke an .aspx page and get its output
    > using the framework? I suppose i can create a client app and execute the url
    > but I'm thinking there must be a way to do it with the framework.
    >
    > thanks,
    >
    > john
    >
    >
    >
     
    =?Utf-8?B?SGF2YWdhbg==?=, Jan 11, 2006
    #3
    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. Pawel Banys
    Replies:
    1
    Views:
    501
    Joe Smith
    Jul 8, 2004
  2. John M
    Replies:
    1
    Views:
    1,231
    Kumar Reddi
    May 29, 2005
  3. Max
    Replies:
    7
    Views:
    9,154
  4. Savas Ates
    Replies:
    1
    Views:
    294
    Patrice
    Aug 17, 2004
  5. Li Chen
    Replies:
    0
    Views:
    137
    Li Chen
    Dec 20, 2006
Loading...

Share This Page