473,513 Members | 2,406 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Image control does not refresh

Hello All

I have an image control in main.aspx in a method

BuildImage()
{
//...code..
imgDisks.ImageUrl = "barChart.aspx";

}

This is called whenever the user Clicks on Submit button:

In barChart.aspx I do:
private void Page_Load(object sender, System.EventArgs e)
{
Chart chart = getChart();
Bitmap bitmap = new Bitmap(chart.Width, chart.Height,
PixelFormat.Format32bppArgb);
Graphics g = Graphics.FromImage(bitmap);
chart.draw(g);

MemoryStream stream = new MemoryStream();
bitmap.Save(stream, ImageFormat.Png);

Response.Clear();
Response.ContentType = "image/png";
Response.BinaryWrite(stream.ToArray());
g.Dispose();
}

However I still have to sometimes click on submit twice to get the new
image. Any pointers on what might be happening are greatly
appreciated.

thanks
Sunit
sj****@ingr.com
Nov 17 '05 #1
1 2014
It's possible that your page is being loaded from the
cache on the browser.
Try adding junk(random) to the URL and see if that helps.
(i.e. mypage.asps?junk=1340891234809)

HTH,
Suresh.
-----Original Message-----
Hello All

I have an image control in main.aspx in a method

BuildImage()
{
//...code..
imgDisks.ImageUrl = "barChart.aspx";

}

This is called whenever the user Clicks on Submit button:

In barChart.aspx I do:
private void Page_Load(object sender, System.EventArgs e)
{
Chart chart = getChart();
Bitmap bitmap = new Bitmap(chart.Width, chart.Height, PixelFormat.Format32bppArgb); Graphics g = Graphics.FromImage(bitmap);
chart.draw(g);

MemoryStream stream = new MemoryStream();
bitmap.Save(stream, ImageFormat.Png);

Response.Clear();
Response.ContentType = "image/png";
Response.BinaryWrite(stream.ToArray());
g.Dispose();
}

However I still have to sometimes click on submit twice to get the newimage. Any pointers on what might be happening are greatly
appreciated.

thanks
Sunit
sj****@ingr.com
.

Nov 17 '05 #2

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

Similar topics

6
8764
by: Arnold | last post by:
Hey there, I've browsed for some fixes to this but only found a couple of similar posts, which didn't solve my problem. I'm wondering how to refresh an image control in a form after a user...
6
3447
by: Arnold | last post by:
Hi there, I've looked at numerous posts out there but have yet to find a solution to this. I have an image control on a main form that shows a linked jpeg thumbnail. Image controls are also on...
1
3294
by: Roberto Castro | last post by:
I have some problems with the way I am showing the BLOB fields in the Image web controls. It does work on my localhost though sometimes I need to hit Refresh for the images to load properly....
2
2657
by: Rainer Sinsch | last post by:
Hello everyone, does anyone know, how I can refresh a webform image by pressing an asp.net-button? I have a statistics-jpg which gets updated every 5 minutes and want to provide a manual...
6
2507
by: Suraj Joneja | last post by:
Hi All, I've an image control on my ASP.net page. This displays an image named 'Logo.jpg' in the location '~\Images'. Another application can change this image. It can select any image and...
1
3283
by: M West | last post by:
continuation of my previous post, thanks to all those that contributed with answers I am creating a control that will take an image and make parts of it transparent, this is done by creating and...
5
2545
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...
0
1172
by: PeterKellner | last post by:
I have an asp.net 2.0 Image control that I have surrounded with the appropriate atlas:UpdatePanel tags. The Image control referencs an aspx page whose only job is to output an Image. (it forms...
11
5650
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...
32
3094
by: C. (http://symcbean.blogspot.com/) | last post by:
Hi all, I have an application which generates image graphs. These cache nicely at the client, however if the user submits more data, I'd like to force a reload of the image from the server. I...
0
7264
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,...
0
7386
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,...
0
7534
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...
0
5689
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,...
1
5094
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...
0
4749
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...
0
1601
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 ...
1
805
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
459
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...

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.