You want to ensure a page has a link to a particular jpg file? i.e. has <IMG src="image1.jpg">? That sounds like a time-of-publishing action; why would you want to check that for each request?
If you think at request time is still a requirement, keep in mind that images could be turned off in the browser or that image could be cached and the browser may never (or never again) request that image when (or around when) page1.aspx is requested. Not to mention, when you've got thousands of users requesting a page you wouldnt be able to tell if a request for image1.jpg was as a result of accessing page1.asp in a stateless environment. There is the HtmlDocument class in .NET 2.0... On Wed, 8 Mar 2006 14:58:10 +0000, Paul Cowan <[EMAIL PROTECTED]> wrote: >Thanks Peter, > >It is a long and complicated story but as simply as I can put it, we have to >ensure that a particular .jpg file is on a requested page. My first >thoughts were to use javascript to parse the DOM but we cannot guarantee >that the element was rendered by an external .js file. > >That is the requirement put as simply as I can. > >We want to automate this process. The Html that is coming back is not XHTML >compliant or I would consider using the XmlHTTPRequest object. > >Can you think of a simpler way to achieve this than examining the >HttpResponse. > >Thanks > >Paul > > > >[EMAIL PROTECTED] > > > > > >>From: Peter Ritchie <[EMAIL PROTECTED]> >>Reply-To: "Discussion of advanced .NET topics." >><[email protected]> >>To: [email protected] >>Subject: Re: [ADVANCED-DOTNET] HTTP help >>Date: Wed, 8 Mar 2006 09:49:08 -0500 >> >>I assume you mean resources linked to via the likes of <img >>href="Image1.jpg">. Those "links" are retrieved as separate HTTP >>requests; and whenever the browser feels like it. There's no guarantee >>they'll be requested adjacent to the original page's request either. >> >>If you want to find out what dependant files page1.aspx links to you'll >>have to parse the HTML returned from page1.aspx looking for "link" >>elements like IMG or LINK. >> >>Why do you need to do this? I ask because it influences how you would go >>about achieving this. >> >>On Wed, 8 Mar 2006 14:36:46 +0000, Paul Cowan <[EMAIL PROTECTED]> wrote: >> >> >Hi all, >> > >> >Can anyone help me with the following requirements? We want to parse an >> >HTTP request for a web page and display all the constituent parts that >>make >> >up the web page. That is I want to display all the additional requests >>that >> >are made to make up the whole page (i.e. css, images and javascript >>files). >> >Say I make a request for page1.aspx then the system would log that it is >> >made up of the following resources: >> > >> >Default.css >> >Modern.css >> >Image1.jpg >> >Script.js >> >Etc., etc. >> > >> >I have no idea how to achieve this, does anybody know?? =================================== This list is hosted by DevelopMentor® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com
