Solved

iframe refresh problem

Posted on 2003-11-14
4
823 Views
Last Modified: 2008-03-10
Hi there,

I have a site starting with the page "index.aspx" which contains an iframe and its source is default.aspx (in fact the original start up page is default.aspx, I used iframe just to hide the URL)

while I am browsing other pages linked to default.aspx and click the refresh button, browser goes back to dafeult.aspx.

How can I stay on the current page?

Thanks...
0
Comment
Question by:burakbaysal
[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
4 Comments
 
LVL 17

Accepted Solution

by:
dorward earned 250 total points
ID: 9747241
You can't. When you load the page, the content of the iframe is determined by the src attribute. You would have to change the src attribute to change the page loaded when you refresh.

Obscuring the URI is pretty pointless anyway. Anyone who wants to find it can do so with little difficulty, so you just create an annoying barrier for the visitor.
0
 
LVL 31

Assisted Solution

by:seanpowell
seanpowell earned 250 total points
ID: 9747362
The browser refresh button will always reload the parent frame, not the current src of the iframe. One option you can use would be to include a refresh button in the actual iframe page, displayed prominently so people are likely to use it instead of the browser one. But it's not foolproff obviously.


Each iframe page would have the following, with the form action set the the name of the page:

<html>
<head>
<script language="JavaScript1.2">
<!--
function refresh()
{
    window.location.reload( false );
}
//-->
</script>
</head>
<body>
<form method="GET" action="contacts.htm">
<input type="button" onclick="refresh()" value="Refresh Page" name="mybutton">
</form>
<h1>Contact Us Page</h1>
</body>
</html>
0

Featured Post

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

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

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

623 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