?
Solved

My image in an IFRAME:d document doesn't reload

Posted on 2003-12-09
8
Medium Priority
?
535 Views
Last Modified: 2008-02-01
I have a window that contains an iframe tag. The document in the iframe tag is an aspx file that displays a map, and navigation arrows (north, south, west, east). When I press an arrow, a sub in my aspx file executes on the server, retrieving the new map, and places it in a session variable. That variable is read by the image file (also an aspx) and is written with the response object to the client.

When I run the iframe:d document in a separate window, it works fine, but when the document is in the iframe, the image doesn't reload, and thus doesn't display the new map. Please help me and explain why.

I have used Response.Cache.SetCacheability(HttpCacheability.NoCache) in the map.aspx as well as the iframed aspx document. In the surrounding document, I have used Response.CacheControl = "Private" and Response.Expires = 0.

- Niklas
0
Comment
Question by:nringdahl
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 7

Expert Comment

by:gam3r_3xtr3m3
ID: 9903588
well, i can't think of any solution. but try to empty your cache then try the script again.
0
 
LVL 1

Author Comment

by:nringdahl
ID: 9903617
Empty how? I have already set the cache to "do not cache" (see original question). Or am I missing something?

- Niklas
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 9904814
show us the browser code as well.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 1

Author Comment

by:nringdahl
ID: 9905152
Ok, I can't send you all the code, but here are some parts. Please let me know if there are specific parts that you would like to see.

- Niklas

details.asp:
...
<%      Response.CacheControl = "Private"
      Response.Expires = 0
%>
...
      <script language="javascript">
      
      function showMap() {
      
            window.resizeTo(650, 800);
            document.all("frameKarta").src = "<%=mapLink%>";
            document.all("frameKarta").height="400";
            document.all("frameKarta").width="500";
            
      }
      
      </script>

...
<iframe id="frameKarta" src="" frameborder="0" marginheight="0" marginwidth="0" height=0 width=0 scrolling=no></iframe>
...
0
 
LVL 11

Expert Comment

by:Zontar
ID: 9924766
Do not use document.all.

1. MSIE only.

2. Even MSDN says it's deprecated and should no longer be used.

Use <iframe name="frameKarta" width="500" height="400">(Your browser doesn't support inline frames.)</iframe
<input type="button" value="Show Map" onclick="showMap();">
<script type="text/javascript">
function showMap()
{
  window.resizeTo(650, 800);  //  not good -- what does this to for people using 800x600 resolution?
  window.frames["frameKarta"].src = "<%=mapLink%>";
}
</script>
0
 
LVL 1

Accepted Solution

by:
nringdahl earned 0 total points
ID: 9950637
Hello.

Zontar: window.frames doesn't work.

I have solved the problem myself. Apparently, despite my efforts to prevent caching, the image was somehow cached. When I opened the image file in a separate window, the updates went smoothly. So I added a random number to the url of the map image, and it fooled the web server enough to reload my image every time.

Thanks for everybodys effort, but I can't give my points to either of you. Wonder if I can give it to myself?

- Niklas
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question