tags:

views:

36

answers:

2
+1  Q: 

Removing frames

Hi,

I am trying to reorganize a site. There are some frame pages which I would like to remove as the same result can be achieved with less overhead. However, the frame below:

<frame name="right" src="/PageTurn/BrowsePub.aspx?
PublicationID=<%=PubID%>&RunDate=<%=Server.URLEncode(PubDate)%>"
scrolling="auto"   marginwidth="0" marginheight="0">

I would like to remove but I have tried to use an include but I get the error message that the file cannot be found? Why does it work within a frame but not as an include? I also tried with an iframe and got the same result.

Curious to know why it works as a frame.

I tried a virual include:

<!--#include virtual="/PageTurn/BrowsePub.aspx?
PublicationID=<%=PubID%>&RunDate
=<%=Server.URLEncode(PubDate)%>"-->

to no avail.

Thanks, R.

+1  A: 

Sounds to me as though you are attempting to use #include in a classic ASP page but the target is an ASPX page.

#include works by simply taking the text found in the include file and inserting at the point the #include is found. No form of request or processing is done the full as-is text of the source file is dumped into the referencing file. The combined chunk of text is then processed by the Classic ASP script handler. Since the text of the ASPX file is using ASP.NET code this is simply not going to work.

One option would be to convert the containing page to an ASPX and covert the included page to an ASCX, IOW take the ASP.NET approach to solving this type of problem.

If the containing page has no further content to provide to the output it may be possible to perform a Server.Transfer but I wouldn't recommend it, its just too messy.

AnthonyWJones
A: 

I managed to achieve everything that I wanted by using an iframe in the end.

The trouble is the link is dynamic which was why I was unable to use the virtual include which is what I wanted to do, so in the end i had this:

<iframe id="browse_frame" src="/PageTurn/BrowsePub.aspx?PublicationID=<%=PubID%>&RunDate=<%=Server.URLEncode(PubDate)%>" 
width="100%" height="600px" marginwidth="0" marginheight="0" frameborder="0" scrolling="auto">
</iframe>

The src is actually a custom app. Its one of those tricky situations where we are updating an old site and including new functionality that is ajax based, plus updating the platform and this has necessitated combining both classic asp and .net pages. We do intend in the end to upgrade everything to .net but as you know, time and money is always a factor.

flavour404