Solved

How to open an ASP file in a DIV

Posted on 2002-06-24
9
231 Views
Last Modified: 2011-10-03
I open an asp file by clicking on a menu choice, when I do so, the file opens in a Frame.  Is it possible to have the asp file open in a DIV in the frame instead of the entire frAMe?
Thanks in advance
0
Comment
Question by:Chris_m
9 Comments
 
LVL 2

Expert Comment

by:ManuelMSP
Comment Utility
I don't think it is possible, because DIV is used on the Client side while an ASP page has to be processed on the server and has to be send back as HTML to to client.
0
 
LVL 22

Accepted Solution

by:
CJ_S earned 50 total points
Comment Utility
For Netscape you can using
document.layers["layername"].load("url", 500);

for IE you'll have to tweak. You'll have to create a hidden iframe and after done loading you copy the contents into the DIV

<iframe id="if1" name="if1" style="visibility:hidden;"></iframe>
<div id="mydiv" style="position:absolute;top:100px;left:100px;width:100px;height:200px;"></div>

Following script will load a page:
function loadit(sURL)
{
   if(document.layers) document.layers["mydiv"].load(sURL, 500);
   else
   {
      document.if1.location = sURL;
   }
}

In the url that you load you put:
function document_onload()
{
   if(document.layers) return;
   top.document.mydiv.innerHTML = document.body.innerHTML;
}
window.onload=document_onload;

That should do the trick.

CJ
0
 

Author Comment

by:Chris_m
Comment Utility
Hello CJ
I get the asp page displaying in the iframe ok, but thereafter I seem to have a problem.  When you say: "In the url that you load you put:..." do you mean that I include that function in the asp file?
Regards

0
 
LVL 22

Expert Comment

by:CJ_S
Comment Utility
Yes.

CJ
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 22

Expert Comment

by:CJ_S
Comment Utility
0
 
LVL 5

Expert Comment

by:kcm76
Comment Utility
CJ:
it is not opening in my browser

0
 
LVL 22

Expert Comment

by:CJ_S
Comment Utility
kcm76,
what browser? Should work properly on IE4+, NS4+ on PC and Macintosh.

CJ
0
 
LVL 5

Expert Comment

by:kcm76
Comment Utility
opera 6.01
0
 
LVL 22

Expert Comment

by:CJ_S
Comment Utility
Then I suggest you turn on popup windows ;-)
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

763 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now