473,657 Members | 2,591 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 (HttpCacheabili ty.NoCache);

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

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 1996
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(i magepath.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 (HttpCacheabili ty.NoCache);

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

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.

"MasterGaur av (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(i magepath.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 (HttpCacheabili ty.NoCache);

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

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**@discussio ns.microsoft.co mwrote in message
news:C9******** *************** ***********@mic rosoft.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.

"MasterGaur av (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 (HttpCacheabili ty.NoCache);
and use:
myPic.ImageURL = picURL + "?time=" + DateTime.Now.Ti cks
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********@joer gjooss.de
Feb 27 '07 #7

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

Similar topics

1
2497
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- John
1
2213
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 the same database table, from the same collumn of the table. However I could not reproduce this, since each Row (with 4 collumns) displays 4 times the same image. How can i fix it? here is a part of the code:
0
1228
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 each employee using a popup layer but am not sure how I match the Active Directory Data to the correct image stored in an SQL database. I plan on using the users fullname or email address as an identifier to match up the image with the correct...
4
4891
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 display ok ..and shows in view source as ....... <img id="gvwExample_ctl07_Image2" src=".\images\toys\1_16\thumb\t_15511.jpg" style="border-width:0px;" />
11
5661
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 didn't help. The problem is that this page does not change images after a client uploads a new one. If I hit the browser's refresh, then I can see the updated image, but if I don't refresh, then I see the previous image.
0
2882
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 DetailsView updateable, but scripts and images would be nice to be seperated.
11
12453
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 oHtmlTextWriter As System.Web.UI.HtmlTextWriter = New System.Web.UI.HtmlTextWriter(oStringWriter)
0
3970
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" OnLoad="upRemoveUser_Load"> <ContentTemplate> <center> <asp:Panel ID="pnlInfoRemove" runat="server" Height="20px" Width="400px" Visible="false"> <asp:Image ID="imgInfoRemove"
6
5399
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 doesn't show the image its supposed to show for an un-authenticated user. I'm guessing its something to do with refreshing the page.. but even when I manually refresh the page it doesn't work. Hope someone can help me asap, i've spent too much time on...
2
4955
by: sajankonni | last post by:
i want to refresh image buttons in asp.net,only without reloading the entire page.
0
8392
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
8823
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...
1
8503
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
8603
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
7320
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
5632
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
4151
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...
1
2726
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
2
1604
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.