473,799 Members | 3,121 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Weird Browser Request

I have a page in ASP.Net 1.1 which contains an image control.

I set the ImageUrl property = "MyImageViewerP age.aspx"

This page acts as an image handler. I have an array of bytes which I send to
the browser using BinaryWrite.

e.g. Response.Conten tType = mVar.contenttyp e
Response.Binary Write(mVar.MyBy tes)

This all works great.

The problem is that if I request the main page using 2 different links I
sometimes get the wrong image.
But other times I get the right image. There is no pattern to this.

What I have found is that if I set a break point in page load of my image
handler page that it does not always get called. I confirmed this behavior
using Fiddler.

When I call the main page and I get the right image, Fiddler shows 2
requests - one for the main page and one for the image.

When I call the main page and get the wrong image, Fiddler only shows a
single request for the main page.
(Note the wrong image is just the image from the previous request that
worked. The rest of the data on the main page changes to the right record -
but since the image handler never gets called the old image is now shown on
the page.)

The question is - why does my browser not request the image handler page
every time?
I have even tried hardcoding it using an html control instead of an asp
control. No luck.
(BTW - both pages have expires = -1 in Fiddler.)

Thanks for any ideas.
--
Joe Fallon


Nov 20 '05 #1
3 1436
the browser and proxy servers cache the images. set the page to expire, or
better yet decorate the url with an image id (then you get the caching if
they return to an old page).

-- bruce (sqlwork.com)
"Joe Fallon" <jf******@nospa mtwcny.rr.com> wrote in message
news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
I have a page in ASP.Net 1.1 which contains an image control.

I set the ImageUrl property = "MyImageViewerP age.aspx"

This page acts as an image handler. I have an array of bytes which I send
to the browser using BinaryWrite.

e.g. Response.Conten tType = mVar.contenttyp e
Response.Binary Write(mVar.MyBy tes)

This all works great.

The problem is that if I request the main page using 2 different links I
sometimes get the wrong image.
But other times I get the right image. There is no pattern to this.

What I have found is that if I set a break point in page load of my image
handler page that it does not always get called. I confirmed this behavior
using Fiddler.

When I call the main page and I get the right image, Fiddler shows 2
requests - one for the main page and one for the image.

When I call the main page and get the wrong image, Fiddler only shows a
single request for the main page.
(Note the wrong image is just the image from the previous request that
worked. The rest of the data on the main page changes to the right
record - but since the image handler never gets called the old image is
now shown on the page.)

The question is - why does my browser not request the image handler page
every time?
I have even tried hardcoding it using an html control instead of an asp
control. No luck.
(BTW - both pages have expires = -1 in Fiddler.)

Thanks for any ideas.
--
Joe Fallon

Nov 20 '05 #2
Bruce,
Thanks for the quick response.

I have this code in both the main page and the image handler page:

Response.Buffer = True
Response.Expire sAbsolute = Now().Subtract( New TimeSpan(1, 0, 0, 0))
Response.Expire s = 0
Response.CacheC ontrol = "no-cache"

So I would think that there is no caching going on.
Also, Fiddler does not show a 302 for the image when it is cached - there is
no request for it at all.

--
Joe Fallon

"Bruce Barker" <br************ ******@safeco.c om> wrote in message
news:OM******** ******@TK2MSFTN GP09.phx.gbl...
the browser and proxy servers cache the images. set the page to expire, or
better yet decorate the url with an image id (then you get the caching if
they return to an old page).

-- bruce (sqlwork.com)
"Joe Fallon" <jf******@nospa mtwcny.rr.com> wrote in message
news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
I have a page in ASP.Net 1.1 which contains an image control.

I set the ImageUrl property = "MyImageViewerP age.aspx"

This page acts as an image handler. I have an array of bytes which I send
to the browser using BinaryWrite.

e.g. Response.Conten tType = mVar.contenttyp e
Response.Binary Write(mVar.MyBy tes)

This all works great.

The problem is that if I request the main page using 2 different links I
sometimes get the wrong image.
But other times I get the right image. There is no pattern to this.

What I have found is that if I set a break point in page load of my image
handler page that it does not always get called. I confirmed this
behavior using Fiddler.

When I call the main page and I get the right image, Fiddler shows 2
requests - one for the main page and one for the image.

When I call the main page and get the wrong image, Fiddler only shows a
single request for the main page.
(Note the wrong image is just the image from the previous request that
worked. The rest of the data on the main page changes to the right
record - but since the image handler never gets called the old image is
now shown on the page.)

The question is - why does my browser not request the image handler page
every time?
I have even tried hardcoding it using an html control instead of an asp
control. No luck.
(BTW - both pages have expires = -1 in Fiddler.)

Thanks for any ideas.
--
Joe Fallon


Nov 20 '05 #3
Bruce,
I used your idea of adding an imageID to the querystring and now it works.

I set the ImageUrl property = "MyImageViewerP age.aspx?imageI D=123"

Thanks for the advice.
--
Joe Fallon

"Bruce Barker" <br************ ******@safeco.c om> wrote in message
news:OM******** ******@TK2MSFTN GP09.phx.gbl...
the browser and proxy servers cache the images. set the page to expire, or
better yet decorate the url with an image id (then you get the caching if
they return to an old page).

-- bruce (sqlwork.com)
"Joe Fallon" <jf******@nospa mtwcny.rr.com> wrote in message
news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
I have a page in ASP.Net 1.1 which contains an image control.

I set the ImageUrl property = "MyImageViewerP age.aspx"

This page acts as an image handler. I have an array of bytes which I send
to the browser using BinaryWrite.

e.g. Response.Conten tType = mVar.contenttyp e
Response.Binary Write(mVar.MyBy tes)

This all works great.

The problem is that if I request the main page using 2 different links I
sometimes get the wrong image.
But other times I get the right image. There is no pattern to this.

What I have found is that if I set a break point in page load of my image
handler page that it does not always get called. I confirmed this
behavior using Fiddler.

When I call the main page and I get the right image, Fiddler shows 2
requests - one for the main page and one for the image.

When I call the main page and get the wrong image, Fiddler only shows a
single request for the main page.
(Note the wrong image is just the image from the previous request that
worked. The rest of the data on the main page changes to the right
record - but since the image handler never gets called the old image is
now shown on the page.)

The question is - why does my browser not request the image handler page
every time?
I have even tried hardcoding it using an html control instead of an asp
control. No luck.
(BTW - both pages have expires = -1 in Fiddler.)

Thanks for any ideas.
--
Joe Fallon


Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1249
by: VB Programmer | last post by:
I went to a few ASP.NET websites today. For some aspx pages I get this error (too consistently, which is why I think it's my PC): Server Error in '/CuteEditorTest' Application. ---------------------------------------------------------------------------- ---- Culture name rs1_4d1e6891cd6 is not supported. Parameter name: name Description: An unhandled exception occurred during the execution of the
2
5199
by: Roger Twomey | last post by:
I have an application that checks for browser, version and active X enabled. It uses the result for a simple if then. The issue I have is that Request.Browser.MajorVersion is returning the wrong value. I was not getting the result I wanted (no IE browser was version >= 5) even when the browser was version 6. I tried from 2 machines, both running IE 6 with all patches installed. For some reason Request.Browser.MajorVersion returns...
1
1701
by: hecsan07 | last post by:
I am trying to perform site login using values from a cookie, but for some weird reason the cookie is being destroyed after the browser window is closed. I checked the browser settings for the cookies, and there is nothing there that terminates cookies uopn browser close. The following is a sample of the code I am runinng: To write the cookie: This code runs if the user is not logged on the site and the cookie does not exist.
2
8102
by: Craig G | last post by:
is there a way to distinguish whether a client is using IE or Netscape? is there some sorta check i can run on the Page_Load event? or where would be the best place to do this? Cheers, Craig
4
1055
by: Brian | last post by:
I replaced my submit buttons with image buttons on my forms.. I need to display the results of the fields that were entered. On my test server, it works great, but on my live server, I am seeing Button1.x and Button1.y. Here is my code. Can someone tell me why i can't stop them from showing on the live server?? TIA ------------------------------------------------------------ Dim answer As String
1
7747
by: Dees | last post by:
Hi, I am facing a weird problem with HTTPS and Request.Url.AbsoluteUri in my ASP.NET application. Here is the scenario - 1. I have a menu page (Default.aspx), which has the following anchor - <a href="ApplicationHost.aspx">Open Application</a> 2. The ApplicationHost.aspx has the following code in its Load event handler - 'ASSUMPTION -
2
1429
by: Todd | last post by:
I'm writing a cookie in one asp.net page, then trying to read that new value in another. Problem is, the saved value disappears when the cookie code calls it! Here's the code... SETTING THE COOKIE ********************************************************* Dim i As String = Request.QueryString("passedVal").ToString
5
3635
by: Mufasa | last post by:
We want to keep track of what OS/Browser people are using for our website. How can I find that out so that I can write it to a DB ? I know how to get it into the DB; I just need to know how to get that stuff in .Net. Thanks. J.
7
4693
by: Anil | last post by:
I have a Javascript program which runs in the browser and has functions work(), and stop(). It listens to commands from the server to work() and can be interrupted by the server to stop(). I am using XmlHttpRequest to talk to the server. So I use http GET to send a command "ready" to the server, which replies at some point in time by sending "work" which is invoked by the callback. As per my understanding, the browser client is single...
0
9685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9538
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10470
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10023
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9067
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6803
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5459
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5583
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4135
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.