S
Sunit Joshi
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
(e-mail address removed)
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
(e-mail address removed)