• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 249
  • Last Modified:

How to open an ASP file in a DIV

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
Chris_m
Asked:
Chris_m
1 Solution
 
ManuelMSPCommented:
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
 
CJ_SCommented:
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
 
Chris_mAuthor Commented:
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
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
CJ_SCommented:
Yes.

CJ
0
 
CJ_SCommented:
0
 
Chandramouli kArchitectCommented:
CJ:
it is not opening in my browser

0
 
CJ_SCommented:
kcm76,
what browser? Should work properly on IE4+, NS4+ on PC and Macintosh.

CJ
0
 
Chandramouli kArchitectCommented:
opera 6.01
0
 
CJ_SCommented:
Then I suggest you turn on popup windows ;-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now