views:

10

answers:

1

Hi.

Microsoft MVC, C#, IIS, CSS question.

I have a problem with the following scenario in IE6:

I have a View that would display a variable number of images, each image returned from the controller side as a BinaryResult.

These BinaryResult objects are then assigned to the src attribute of the img elements in the page.

Example, if I load a page which has N number of images in it, I would be making N number of controller calls to get these images. These images are just very small thumbnails and in a page there could only be a maximum number of 40 thumbnails.

This approach seem to work fine in IE8, IE7.

However, in IE6, it would only load initially. If I move away from the page then move back, the image loading would cause Ie6 to freeze up. ( well, basically you can leave it for an hour after which it would be responsive -- but the images are not displayed at all).

Initially- I defaulted to stripping down the CSS (thinking its IE6.. but it seemed to work fine if I display images that were not retrieved via BinaryResult).

Also, IIS server settings for compression as well as IE6 browser memory settings were tweaked.

Could really appreciate any help -- if anyone out there has experienced a similar problem.

A: 

Not sure what the issue might be but try this:

public ActionResult Image()
{
    byte[] image = FetchImage();
    return File(image, "image/png"); // adjust content type appropriately
}

And in your view:

<img src="<%= Url.Action("Image") %>" alt="" />
Darin Dimitrov