Solved

How to open an ASP file in a DIV

Posted on 2002-06-24
9
235 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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
LVL 22

Expert Comment

by:CJ_S
ID: 7103356
Yes.

CJ
0
 
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Using AJAX to call classic ASP function 4 93
currencylayer API intergrate to ASP 25 71
add custom headers to my mail 2 55
How to show result of a NULL value at random? 32 50
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

805 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