M
Mark S.
Hello,
On a high volume page we have the following JavaScript:
img = new Image()
img.src = 'http://myserver.com/count.aspx?x=1';
and it works fine, but now we've added:
img.onload = myImgLoaded
and it fails on IE and FF. The reason being it's not returning a proper
image, simply text. When a gif/jpg is returned it fires the onload event
every time.
Below I've sketched out how I might get the aspx page to return as an image,
but I would greatly appreciate help flushing it out.
void Application_Start(object sender, EventArgs e)
{
// i think i have to start with a bmp, not sure how to get it to gif or jpg
Bitmap bitmapSpacer = new Bitmap(1, 1);
}
private void Page_Load(object sender, System.EventArgs e)
{
// set the header
Response.ContentType = "image/gif";
// misc biz logic here
// return the image
// keep in mind I don't want to create this image each page loads nor load
it from the hard drive nor create a img tag
Response.Write(bitmapSpacer); // Can it can be returned this way?
}
Thank you.
On a high volume page we have the following JavaScript:
img = new Image()
img.src = 'http://myserver.com/count.aspx?x=1';
and it works fine, but now we've added:
img.onload = myImgLoaded
and it fails on IE and FF. The reason being it's not returning a proper
image, simply text. When a gif/jpg is returned it fires the onload event
every time.
Below I've sketched out how I might get the aspx page to return as an image,
but I would greatly appreciate help flushing it out.
void Application_Start(object sender, EventArgs e)
{
// i think i have to start with a bmp, not sure how to get it to gif or jpg
Bitmap bitmapSpacer = new Bitmap(1, 1);
}
private void Page_Load(object sender, System.EventArgs e)
{
// set the header
Response.ContentType = "image/gif";
// misc biz logic here
// return the image
// keep in mind I don't want to create this image each page loads nor load
it from the hard drive nor create a img tag
Response.Write(bitmapSpacer); // Can it can be returned this way?
}
Thank you.