0

I'm trying to get the list of requests that occur within the confines of a single httpwebrequest from my aspx page.

When using fiddler, you request a page from IE. While doing that request the page requests x number of other files as part of the request. Fiddler shows you that you are getting a .css file, a .js file and maybe its's also requesting a couple other pages from that page before it renders.

I want to be able to make the httpwebrequest from my aspx page then monitor (or list out) the URLs that are being called within that request.

That said I am open to alternate ways to do the request. e.g. IFRAME, etc.

Maybe this just can't be done from an aspx page. Ideas?

Wegener
  • 1
  • 1
  • You can see the list when you create the page (scripts, css, images, ...) + dynamically generated requests from javascript (that you only see from client-side). – Jaroslav Jandek Mar 07 '11 at 15:26

2 Answers2

1

If you are using an HttpWebRequest on the server, it is not going to download all of the other embedded resources. If you want to get the list of resources used on the page, you'll have to parse the HTML yourself.

Here's a related questions that might be useful: How can I use HTML Agility Pack to retrieve all the images from a website?

Community
  • 1
  • 1
David
  • 34,223
  • 3
  • 62
  • 80
-1

This cannot be done from ASPX page. I think you should hook on one of the Global ASAX events (via writing custom HttpModule) and intercept the requests there.

Genady Sergeev
  • 1,650
  • 9
  • 11