473,320 Members | 1,951 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Refresh image in asp:Image-control

Hello!

I've seen a lot of post about this but every one of them ends up with the
same solution:

Set:

Response.Cache.SetExpires(new DateTime(2000, 1, 1)); // some date in the
past....
Response.Cache.SetCacheability(HttpCacheability.No Cache);

and use:
myPic.ImageURL = picURL + "?time=" + DateTime.Now.Ticks

or something like that. This has worked for me too, until now. One customer
can't get the picture to refresh. I've checked that the image-file changes on
the server and that the src value of the img-tag in the page is different.
Everything changes as it should except the image. How can I force it to show
the right image?

Thanks!
Feb 27 '07 #1
6 1986
or something like that. This has worked for me too, until now. One
customer
can't get the picture to refresh. I've checked that the image-file changes
on
Have you checked the customer's client settings for cache?
Is it, accidently, set to "Never lookup data on network" (always use cache)?
--
Happy Hacking,
Gaurav Vaish | www.mastergaurav.com
www.edujini-labs.com
http://eduzine.edujini-labs.com
-----------------------------------------
Feb 27 '07 #2
Hi,
try appending a random number to the image url.

For example,

string url = string.format(imagepath.gif?r={0}, rnd()*10000)

Hopefully this has helped you.
--
Thanks and Regards.
Manish Bafna.
MCP and MCTS.

"Miro" wrote:
Hello!

I've seen a lot of post about this but every one of them ends up with the
same solution:

Set:

Response.Cache.SetExpires(new DateTime(2000, 1, 1)); // some date in the
past....
Response.Cache.SetCacheability(HttpCacheability.No Cache);

and use:
myPic.ImageURL = picURL + "?time=" + DateTime.Now.Ticks

or something like that. This has worked for me too, until now. One customer
can't get the picture to refresh. I've checked that the image-file changes on
the server and that the src value of the img-tag in the page is different.
Everything changes as it should except the image. How can I force it to show
the right image?

Thanks!
Feb 27 '07 #3
Where can you find this setting? I connected my computer to their network and
tried it with the same result so I guess it's not an issue with Internet
Explorer settings.

"MasterGaurav (www.edujini-labs.com)" wrote:
or something like that. This has worked for me too, until now. One
customer
can't get the picture to refresh. I've checked that the image-file changes
on

Have you checked the customer's client settings for cache?
Is it, accidently, set to "Never lookup data on network" (always use cache)?
--
Happy Hacking,
Gaurav Vaish | www.mastergaurav.com
www.edujini-labs.com
http://eduzine.edujini-labs.com
-----------------------------------------
Feb 27 '07 #4
Thanks!

I'll try that but I doubt it makes any difference. Using the Ticks value in
the imageurl also gives a different number each time. I've even controlled it
on the client.

Regards

"Manish Bafna" wrote:
Hi,
try appending a random number to the image url.

For example,

string url = string.format(imagepath.gif?r={0}, rnd()*10000)

Hopefully this has helped you.
--
Thanks and Regards.
Manish Bafna.
MCP and MCTS.

"Miro" wrote:
Hello!

I've seen a lot of post about this but every one of them ends up with the
same solution:

Set:

Response.Cache.SetExpires(new DateTime(2000, 1, 1)); // some date in the
past....
Response.Cache.SetCacheability(HttpCacheability.No Cache);

and use:
myPic.ImageURL = picURL + "?time=" + DateTime.Now.Ticks

or something like that. This has worked for me too, until now. One customer
can't get the picture to refresh. I've checked that the image-file changes on
the server and that the src value of the img-tag in the page is different.
Everything changes as it should except the image. How can I force it to show
the right image?

Thanks!
Feb 27 '07 #5
It could actually be their network provider. Keep in mind, some providers
still have proxy servers that cache files to save on bandwidth. AOL used to
be horrible at this, even caching whole web sites and displaying some that
were days old.

Chances are, if it's happening on their network the network admin has made a
setting somewhere on their domain controller or it has something to do with
their network connection to the internet and a setting on a proxy server or
router.

--

Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006

"Miro" <Mi**@discussions.microsoft.comwrote in message
news:C9**********************************@microsof t.com...
Where can you find this setting? I connected my computer to their network
and
tried it with the same result so I guess it's not an issue with Internet
Explorer settings.

"MasterGaurav (www.edujini-labs.com)" wrote:
or something like that. This has worked for me too, until now. One
customer
can't get the picture to refresh. I've checked that the image-file
changes
on

Have you checked the customer's client settings for cache?
Is it, accidently, set to "Never lookup data on network" (always use
cache)?
--
Happy Hacking,
Gaurav Vaish | www.mastergaurav.com
www.edujini-labs.com
http://eduzine.edujini-labs.com
-----------------------------------------

Feb 27 '07 #6
Thus wrote Miro,
Hello!

I've seen a lot of post about this but every one of them ends up with
the same solution:

Set:

Response.Cache.SetExpires(new DateTime(2000, 1, 1)); // some date in
the
past....
Response.Cache.SetCacheability(HttpCacheability.No Cache);
and use:
myPic.ImageURL = picURL + "?time=" + DateTime.Now.Ticks
or something like that. This has worked for me too, until now. One
customer can't get the picture to refresh. I've checked that the
image-file changes on the server and that the src value of the img-tag
in the page is different. Everything changes as it should except the
image. How can I force it to show the right image?
None of those is a solution if your images are served by IIS directly. Is
this the case here?

--
Joerg Jooss
ne********@joergjooss.de
Feb 27 '07 #7

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

Similar topics

1
by: John Thompson | last post by:
We're sooo close. When we load the page to upload the image, all of the prms go through except the binary image data. Using SQL server with the data type set to "image". Please help! Thanks-...
1
by: ltt19 | last post by:
Hi everyone! I want to do da Image gallery using just the datagrid, this one will dilpays only images, no text, that means that it will have about 4 Collumns that will displays just images from...
0
by: Tim::.. | last post by:
Please, please, please help!!! I have a datagrid that displays a list of contacts on our intranet site using the ActiveDirectory as it's main Data Source. I want to be able to show an image of...
4
by: Deere | last post by:
When I try to take a database field and change it with a function and return it...it will not display the image. The "Imageurl" does not convert to "src=" but stays as ImageUrl. id=Image2 will...
11
by: Jerry J | last post by:
How can I get an asp:Image to refresh when a user uploads a different jpg. I disabled caching using this command on Page_Load(): Response.Cache.SetCacheability(HttpCacheability.No Cache); but it...
0
by: Christian Schlemmer | last post by:
hi, in a DetailsView i have a image display. images i want to store in a seperate directory, but it a path is added to Bind update and delete is not working. just Bind makes my...
11
by: nuhura01 | last post by:
Hi.. I have a button to preview image using the following code, which preview the image in html page: Dim oStringWriter As System.IO.StringWriter = New System.IO.StringWriter Dim...
0
by: wiertara | last post by:
Hi, i have a problem with refreshing data in UpdatePanel. In aspx file i have a AjaxToolKit TabContainer and inside it a UpdatePanel: <asp:UpdatePanel ID="upRemoveUser" runat="server"...
6
Eleven
by: Eleven | last post by:
Hi everybody, I'm trying to load a different logo depending on who's logged in but the code doesn't seem to be working, well, it only works after i've rebooted my PC. Even when I log out it...
2
by: sajankonni | last post by:
i want to refresh image buttons in asp.net,only without reloading the entire page.
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.