Click to See Complete Forum and Search --> : Dynamic Images
London75
Jan 24th, 2005, 08:01 AM
I'm using a .aspx style of dynamic image where I code in the PAGE_Load procedure of a page and set the contenttype to "image/png"
It's working fine but calling the page_load procedure twice which is a quite expensive procedure.
I can implement a cache of some sort but I'd rather know why it is requested twice.
I've specified the image size in the <img> tag already which was my first suspect.
Help!
Memnoch1207
Jan 24th, 2005, 11:07 AM
It would help to see the code.
Magiaus
Jan 24th, 2005, 01:23 PM
If Not IsPostBack Then
ImageCode
End If might help a little. You could also set a rendered flag stored in viewstate and only update the image if it is not rendered.... watch out for the no value(null) error that ViewState properties give if not initalized.
I'm not sure why the load fires twice. You could move your code to Render or PreRender and see what happens.
umm why png?
London75
Jan 24th, 2005, 02:58 PM
The code is too long to post but the general design is a number of parameters are passed on the URL, an XML file containing stats is loaded and plotted in various styles in a chart. The procedure is entirely in Page_Load and is returned with in the response stream.
I'll post some code tomorrow if that doesn't help diagnosing the problem at all.
Thanks for the help so far, I'll try looking at the Render events.
Edit: png was just so that I could easily produce a transparent background to the chart. Well, when I say easy I mean painfully awkward due to IE being annoying.
London75
Jan 25th, 2005, 03:46 AM
Just for anyone with the same problem:
Set the parameter AutoEventWireUp=False
Dammit, why do some problems have to be so simple but take so long. 4 days that took!
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.