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

Home Posts Topics Members FAQ

refresh image in asp.net page

how to refresh a image control to pick up the latest image file on a asp.net
page. i am generating a image based on the input from the user and displaying
it on the page through image control. The problem is that i am not able to
get the latest image on the page, it keeps showing the old page. But when i
hit the refresh button on the toolbar it correctly gets the latest image and
displays it in the control. But that has another problem, it pops up a dialog
asking user whether he wants to retry or cancel...

so in short i need to implement some logic so that the image control is
refreshed when the image changes (i know exactly when the image changes) and
dont popup any dialog box for user input.

any help is greatly appreciated

thanks, Ramendra
Dec 1 '05 #1
5 2562
You can trick the browser into reloading the image from the server by adding
a random query parameter to the image url. I am using a javascript call that
produces the millisecond part of the current time.

Eliyahu

"ramendra" <ra******@discu ssions.microsof t.com> wrote in message
news:01******** *************** ***********@mic rosoft.com...
how to refresh a image control to pick up the latest image file on a
asp.net
page. i am generating a image based on the input from the user and
displaying
it on the page through image control. The problem is that i am not able to
get the latest image on the page, it keeps showing the old page. But when
i
hit the refresh button on the toolbar it correctly gets the latest image
and
displays it in the control. But that has another problem, it pops up a
dialog
asking user whether he wants to retry or cancel...

so in short i need to implement some logic so that the image control is
refreshed when the image changes (i know exactly when the image changes)
and
dont popup any dialog box for user input.

any help is greatly appreciated

thanks, Ramendra

Dec 1 '05 #2
Eliyahu Goldin wrote:
You can trick the browser into reloading the image from the server by
adding a random query parameter to the image url. I am using a
javascript call that produces the millisecond part of the current
time.


Or unleash the full power of HTTP by sending a Cache-Control: no-cache
header ;-)

Cheers,
--
http://www.joergjooss.de
mailto:ne****** **@joergjooss.d e
Dec 1 '05 #3
Hi Eliyahu,

I have added the query string parameter (page.aspx?a=te st) to the image url
but still the image doesn;t seem to get refreshed with the new one.

please clarify you suggestion.

thanks, Ramendra

"Eliyahu Goldin" wrote:
You can trick the browser into reloading the image from the server by adding
a random query parameter to the image url. I am using a javascript call that
produces the millisecond part of the current time.

Eliyahu

"ramendra" <ra******@discu ssions.microsof t.com> wrote in message
news:01******** *************** ***********@mic rosoft.com...
how to refresh a image control to pick up the latest image file on a
asp.net
page. i am generating a image based on the input from the user and
displaying
it on the page through image control. The problem is that i am not able to
get the latest image on the page, it keeps showing the old page. But when
i
hit the refresh button on the toolbar it correctly gets the latest image
and
displays it in the control. But that has another problem, it pops up a
dialog
asking user whether he wants to retry or cancel...

so in short i need to implement some logic so that the image control is
refreshed when the image changes (i know exactly when the image changes)
and
dont popup any dialog box for user input.

any help is greatly appreciated

thanks, Ramendra


Dec 2 '05 #4
I am new to Asp.net and therefore i am not able to understand your suggestion
or i am doing it in wrong way.

-RK

"Eliyahu Goldin" wrote:
You can trick the browser into reloading the image from the server by adding
a random query parameter to the image url. I am using a javascript call that
produces the millisecond part of the current time.

Eliyahu

"ramendra" <ra******@discu ssions.microsof t.com> wrote in message
news:01******** *************** ***********@mic rosoft.com...
how to refresh a image control to pick up the latest image file on a
asp.net
page. i am generating a image based on the input from the user and
displaying
it on the page through image control. The problem is that i am not able to
get the latest image on the page, it keeps showing the old page. But when
i
hit the refresh button on the toolbar it correctly gets the latest image
and
displays it in the control. But that has another problem, it pops up a
dialog
asking user whether he wants to retry or cancel...

so in short i need to implement some logic so that the image control is
refreshed when the image changes (i know exactly when the image changes)
and
dont popup any dialog box for user input.

any help is greatly appreciated

thanks, Ramendra


Dec 2 '05 #5
Hi Eliyahu,

thanks a lot it solved my problem.

thanks, Ramendra

"Eliyahu Goldin" wrote:
You can trick the browser into reloading the image from the server by adding
a random query parameter to the image url. I am using a javascript call that
produces the millisecond part of the current time.

Eliyahu

"ramendra" <ra******@discu ssions.microsof t.com> wrote in message
news:01******** *************** ***********@mic rosoft.com...
how to refresh a image control to pick up the latest image file on a
asp.net
page. i am generating a image based on the input from the user and
displaying
it on the page through image control. The problem is that i am not able to
get the latest image on the page, it keeps showing the old page. But when
i
hit the refresh button on the toolbar it correctly gets the latest image
and
displays it in the control. But that has another problem, it pops up a
dialog
asking user whether he wants to retry or cancel...

so in short i need to implement some logic so that the image control is
refreshed when the image changes (i know exactly when the image changes)
and
dont popup any dialog box for user input.

any help is greatly appreciated

thanks, Ramendra


Dec 2 '05 #6

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

Similar topics

1
8379
by: SPQR | last post by:
Some time ago I set up a webcam at home and a page on my site. Every three minutes the webcam would take a picture of my backyard and ftp it to my site where it was displayed on my webcam page. The image was ftp'ed to ftp://mydomain.org/webcam.jpg. On my website was a file, webcam.htm, that had a place for the image, webcam.jpg. I put an HTML code on my webcam page that caused it to refresh every 3 minutes -- every 3 minutes, the...
1
10858
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
1
3370
by: ppatel | last post by:
Problem I have a problem with web image button control click event. The click event does not get trigger until it has not been clicked once or page refresh occures(which is fine). When click event fires first time it executes code associate with click event(As I expected). the problem is when you refresh page it fires a click event automatically. I looked around many posts and did not find any topics about this problem. Infact the same...
2
2723
by: Just D. | last post by:
All, How should we refresh the current aspx frame? I disabled caching using this command on Page_Load(): Response.Cache.SetCacheability(HttpCacheability.NoCache); but it didn't help. The problem is that this page shows the client Logo image, then asks to upload a new one if required, finally it should show the uploaded picture. The problem is that it doesn't. If I press F5, then I can see the updated
9
2892
by: TCORDON | last post by:
I have a user control that contains 2 image buttons, when you click one of them, both must change the image source, the thing is that the first time you click any one of them the page appears to do a postbak, but the image source or the image displayed does not change until I click one of the images a second time, why dows it take 2 clicks for the user to "refresh"? TIA!
10
23420
by: Fred Nelson | last post by:
Hi: I have a VB.NET web application and I need to find a way to cause a page refresh from within my application. Does anyone know how to force the browser to refresh the current page? Thanks very much for your help! Fred
0
319
by: ramendra | last post by:
how to refresh a image control to pick up the latest image file on a asp.net page. i am generating a image based on the input from the user and displaying it on the page through image control. The problem is that i am not able to get the latest image on the page, it keeps showing the old page. But when i hit the refresh button on the toolbar it correctly gets the latest image and displays it in the control. But that has another problem, it...
2
1479
by: mayla_i | last post by:
Hello experts I have this question which confuse me! so please help me Is there a difference between clicking on the refresh button in the browser and writing this command: "window.location.reload()" (in the meaning of loading images on a page) The problem that I'm facing is as following:
11
5673
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
9687
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
9541
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
10251
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...
0
9072
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...
1
7564
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
6805
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
5585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4139
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
3759
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.