Solved

How to open an ASP file in a DIV

Posted on 2002-06-24
9
232 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
ID: 7103264
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
ID: 7103267
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
ID: 7103338
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
ID: 7103356
Yes.

CJ
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 22

Expert Comment

by:CJ_S
ID: 7103359
0
 
LVL 5

Expert Comment

by:kcm76
ID: 7103421
CJ:
it is not opening in my browser

0
 
LVL 22

Expert Comment

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

CJ
0
 
LVL 5

Expert Comment

by:kcm76
ID: 7103503
opera 6.01
0
 
LVL 22

Expert Comment

by:CJ_S
ID: 7103541
Then I suggest you turn on popup windows ;-)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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 would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

920 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

16 Experts available now in Live!

Get 1:1 Help Now