views:

641

answers:

1

IE 8 is not refreshing a popup window that shows an image with some basic javascript manipulator.

I am trying to investigate issues with IE 8 and ASP.net 3.5 but I am not having much luck with that research.

So what I am doing?

I have a tab container(Ajax control toolkit) that holds a gridview that when you select it, it will show a popup with the selected image. I am passing the image location through a Session variable. In firefox 3.5 it always displays the different images.

Here is the code being inserted into the page for javascript:

Dim javatext As New System.Text.StringBuilder()
Session("ImageLoc") = Path
javatext.Append("<script>window.open('" & "ImageViewer.aspx" & "',null,'left=400,")
javatext.Append(" top=100,height=600px, width=600px, status=no, resizable= yes, scrollbars= yes,")
javatext.Append("toolbar= no,location= no, menubar= no');</script>")

ClientScript.RegisterStartupScript(Me.GetType(), "showTreatMedia", javatext.ToString())

This code with different paths is in two command buttons in the grid view. And the path differs depending on if the user wants a compressed format or the original format. Checking the code it enters the first time but not the second.

Page load of the showing image window:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsNothing(Session("ImageLoc")) Then
            imgPic.ImageUrl = Session("ImageLoc")
        End If
End Sub

Also the site is running in IE7 compatibility mode.

A: 

Ok, what happened was that I was using the same URL all the time. I added this code:

Dim rand As New Random
Dim numvalue As Integer = rand.Next(0, 2000)
Session("ImageLoc") = objMedia.PathFull
javatext.Append("<script>window.open('" & "ImageViewer.aspx?something=" & numvalue & "',null,'left=400,")
javatext.Append(" top=100,height=600px, width=600px, status=no, resizable= yes, scrollbars= yes,")
javatext.Append("toolbar= no,location= no, menubar= no');</script>")

ClientScript.RegisterStartupScript(Me.GetType(), "showTreatMedia", javatext.ToString())

And now it changes the picture every time and picks up the new path. So the holding the path of the image in the session variable was a mistake. And it seems IE8 needs for the path to change to refresh the popup window.

Hope this can help other people.

ThorDivDev
It's likely that the real problem is that your ImageViewer.aspx page wasn't sending caching headers that would prohibit IE from reusing the previously cached version of the page. Learn more here: www.fiddler2.com/redir/?id=httpperf
EricLaw -MSFT-