473,803 Members | 3,625 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Refresh Page

Hello.

I have such problem:
I have ImageButton on my form which is attached to some image like
"image.jpg" , now when I change image file (physically file) with some other
file with the same name my page shows the old image until I click "Refresh"
button of the browser.
So how can I refresh web form from code?
Or may be there is some other way to solve this problem?

Thank you.
Nov 19 '05 #1
6 3678
The image gets cached on client side. You can trick the browser onto
refreshing the image by adding a random number to the image url. For example
image.jpg?1234

Eliyahu

"David" <da*********@ho tmail.com> wrote in message
news:%2******** *******@TK2MSFT NGP12.phx.gbl.. .
Hello.

I have such problem:
I have ImageButton on my form which is attached to some image like
"image.jpg" , now when I change image file (physically file) with some other file with the same name my page shows the old image until I click "Refresh" button of the browser.
So how can I refresh web form from code?
Or may be there is some other way to solve this problem?

Thank you.

Nov 19 '05 #2
No! It's imposable.
Is there any other way?

"Eliyahu Goldin" <re************ *@monarchmed.co m> wrote in message
news:e2******** ********@TK2MSF TNGP14.phx.gbl. ..
The image gets cached on client side. You can trick the browser onto
refreshing the image by adding a random number to the image url. For
example
image.jpg?1234

Eliyahu

"David" <da*********@ho tmail.com> wrote in message
news:%2******** *******@TK2MSFT NGP12.phx.gbl.. .
Hello.

I have such problem:
I have ImageButton on my form which is attached to some image like
"image.jpg" , now when I change image file (physically file) with some

other
file with the same name my page shows the old image until I click

"Refresh"
button of the browser.
So how can I refresh web form from code?
Or may be there is some other way to solve this problem?

Thank you.


Nov 19 '05 #3
Yes, in the code-behind:

Response.Expire sAbsolute = DateTime.Now.Ad dDays (-1);
Response.Cache. SetCacheability (System.Web.Htt pCacheability.N oCache);

Response.Append Header ("Pragma", "no-cache");
Eliyahu

"David" <da*********@ho tmail.com> wrote in message
news:OE******** ******@TK2MSFTN GP14.phx.gbl...
No! It's imposable.
Is there any other way?

"Eliyahu Goldin" <re************ *@monarchmed.co m> wrote in message
news:e2******** ********@TK2MSF TNGP14.phx.gbl. ..
The image gets cached on client side. You can trick the browser onto
refreshing the image by adding a random number to the image url. For
example
image.jpg?1234

Eliyahu

"David" <da*********@ho tmail.com> wrote in message
news:%2******** *******@TK2MSFT NGP12.phx.gbl.. .
Hello.

I have such problem:
I have ImageButton on my form which is attached to some image like
"image.jpg" , now when I change image file (physically file) with some

other
file with the same name my page shows the old image until I click

"Refresh"
button of the browser.
So how can I refresh web form from code?
Or may be there is some other way to solve this problem?

Thank you.



Nov 19 '05 #4
Eliyahu Goldin wrote:
Yes, in the code-behind:

Response.Expire sAbsolute = DateTime.Now.Ad dDays (-1);
Response.Cache. SetCacheability (System.Web.Htt pCacheability.N oCache);

Response.Append Header ("Pragma", "no-cache");


This only affects the page itself, but not any referenced resource. In order
to make the image file non-cacheable, put all it and all other non-cacheable
images in a common folder and assign this folder the HTTP headers

Cache-Control: no-cache (*)
Pragma: no-cache

using the IIS admin applet.

(*) Technically, "Cache-Control: must-revalidate" would be the right choice,
but IE handles this incorrectly :-(
Cheers,
--
Joerg Jooss
www.joergjooss.de
ne**@joergjooss .de

Nov 19 '05 #5
That is the way it should be done. I read a great article about what
yahoo.com does for their impression ads and image tracking. You will need
to put some value on the end of the src.

<img srg="http:\\sit e.com\images\bo b.jpg?5531234">

This will force the client browser to "redownload " the image, as it doesn't
think it has it downloaded already.

bill

"David" <da*********@ho tmail.com> wrote in message
news:OE******** ******@TK2MSFTN GP14.phx.gbl...
No! It's imposable.
Is there any other way?

"Eliyahu Goldin" <re************ *@monarchmed.co m> wrote in message
news:e2******** ********@TK2MSF TNGP14.phx.gbl. ..
The image gets cached on client side. You can trick the browser onto
refreshing the image by adding a random number to the image url. For
example
image.jpg?1234

Eliyahu

"David" <da*********@ho tmail.com> wrote in message
news:%2******** *******@TK2MSFT NGP12.phx.gbl.. .
Hello.

I have such problem:
I have ImageButton on my form which is attached to some image like
"image.jpg" , now when I change image file (physically file) with some

other
file with the same name my page shows the old image until I click

"Refresh"
button of the browser.
So how can I refresh web form from code?
Or may be there is some other way to solve this problem?

Thank you.



Nov 19 '05 #6
William F. Robertson, Jr. wrote:
That is the way it should be done.


Should? No, not really. HTTP 1.1 covers all required cache and expiration
mechanisms. But if you said "must" be done, you're most likely correct.
There are still too many crappy HTTP implementations out there that are
beyond any poor web application developer's control :-(

Cheers,
--
Joerg Jooss
www.joergjooss.de
ne**@joergjooss .de
Nov 19 '05 #7

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

Similar topics

3
12927
by: Scott | last post by:
I have a clickable graph that resides on page 1. If user clicks a data point on the graph, the page runs again yeilding a 2nd graph that shows a more detailed graph. Problem is, I have a recordset table on the 2nd graph page and because the user gets to it by clicking the graph, the page doesn't properly post to render the recordset table. I can click "Refresh" on 2nd page and table displays fine. Is there an ASP refresh command that...
1
10860
by: Marco Maroni | last post by:
How to force image refresh on client browser ? Is ti possible to force the refresh of the same image (tha was changed server-side) to the client, without user press Contrl+F5 in IE ? - Marco
2
23516
by: Jeronimo Bertran | last post by:
Hi, I have a page with a very data intensive grid which needs to be automatically refreshed constantly if a change is detected. In order to not refresh the complete page so often, I created an iframe on my page whose html has the refresh meta as follows : <meta http-equiv="refresh" content="10"> The iframe is effectivelyh refreshed every 10 seconds without having the
1
3170
by: francois | last post by:
I have a ASPX form with a dropdownlist that makes a post back (to the same page of course, just a normal asp.net postback) That page also has an auto refresh javascript as it needs to refresh its data automatically. The problem is that when i click on the dropdownlist, i post back information to the page, then after that the next refresh will brin me a alert message populated by internet explorer saying: "The page cannot be refreshd...
9
7800
by: PK9 | last post by:
I'm having an issue with the "Refresh" of an asp.net page. The refresh is actually calling my last onClick event. I thought that asp.net was supposed to be stateless in that it shouldn't remember that I clicked a button before the refresh. Here is what is going on: 1) Page Loads 2) User enters some values, clicks the "Save" button 3) The onClick event handler for the save button saves the data to the database and the page is...
0
1684
by: Brad White | last post by:
Overview: I have a custom web app that has an 'Inbox' that refreshes every 30 seconds. One user uses Outlook to host the web page. Using IE, the refresh works fine. If the user is working in another window, the web page quietly refreshes in the background. Hosted in Outlook, the refresh causes Outlook to come to the front on every refresh. Or in XP, causes the toolbar icon to flash.
3
2119
by: Kevin | last post by:
Hi guys, I want to refresh some pages every 2 seconds. however, these html pages are not in my site, they could be any pages from yahoo.com or msn.com. I can create a page, which redirect to public internet html page, but how can I do this in a loop? do I need to write a console application to make it work? thanks
8
9402
by: Jason S | last post by:
Hi, is there any way of getting my VB (6.0) program to automatically 'Refresh' an IE window that might be active (window status not applicable). It needs to be able to determine which active IE window to refresh, based on its caption. For example, there is a web site that I want to keep active where I normally have to refresh it manually before it times out (every 15 min or so). I might be doing something else at the time so I don't...
10
32888
by: phforum | last post by:
Hi, I wrote a PHP page for user input the information to search the database. And the database data will update every second. I want to set the auto refresh to get the data from database every minute. But the page always display the dialog box ask me to resend the information. How to disable this warning message. I using POST and REQUEST to get the data from user input page. Thanks all
5
3754
by: =?Utf-8?B?Sm9obg==?= | last post by:
Hi, I used the following code to refresh the parent page, and it works very well (Thanks to Peter Bromberg "). Response.Write("<script language='javascript' type='text/javascript'{ window.opener.location = 'Default.aspx?Reload=100'; }</script>"); Response.Write("<script language='javascript' type='text/javascript'{ self.close(); }</script>");
0
10546
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
10310
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10292
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10068
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...
1
7603
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6841
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
5498
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
5627
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4275
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.