Click here to Skip to main content
16,004,647 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am facing problem to show correct image in popup screen.

On Page load event I am getting image from database in the form of Base64String. I convert it into byte array & than generate a image file in ../temp/ location. after that I set style for background-image & pass the url ../temp/image.JPG.

This code is working fine for IE8 & other browser but problem occoured on IE9.

Below are the steps, when problem occoured.

Step 1 : I click on preview button for image 1.
Step 2 : I passed id = 1 to PopupImage screen.
Step 3 : On Page Load, fetch image on the basis on id = 1
Step 4 : Correct image will be shown
Step 5 : Now I click on preview button for image 2.
Step 6 : I passed id = 2 to PopupImage screen.
Step 7 : Still showing image for id = 1
Step 8 : Refreshing PopupImage screen, Correct image will be shown
Posted

It appears that the image is cached. You should try to change the file name and try your test again. I hope this helps.
 
Share this answer
 
Yes, This issue is due to cached image, but can't change the image name as it is generating dynamically from database.

Thanks a lot for ozkar to direct me in right direction. :)

Now to resolve this issue I am adding a query string with image url. I had to replace only one line in my code & this is working fine now. :)

parentDiv.Style.Add("background-image", "url('" + strImagePath + "')");


replaced by

parentDiv.Style.Add("background-image", "url('" + strImagePath + "?x=" + imageId + "')");


Where imageId is unique in my application. Any unique value can be used at the place of imageId.

Thanks
Prem Kishor
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900