473,786 Members | 2,849 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 2559
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
8378
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
3369
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
5672
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
9496
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
10363
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
10110
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
9961
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
8989
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
6745
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
5397
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...
2
3669
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
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.