Including ASPX page in Classic ASP page?

  • Thread starter Thread starter Chris Ashley
  • Start date Start date
C

Chris Ashley

Hi there,

I need to include an ASPX page within an ASP page. Is this possible?

EG:

making-a-claim.asp is:

<!-- #include file="top.asp" -->

<!-- #include virtual="/contactform/contact.aspx" -->

<!-- #include file="bottom.asp" -->

I get the error:

"Page Command Out Of Order

/contactform/contactus.aspx, line 1

The @ command must be the first command within the Active Server Page.
"

Will I have to go down the IFrame route instead?

Thanks,

Chris
 
Hi Chris,

With that way that includes work in ASP, no this will not work. When you
include files, you're essentially joining two files together before any ASP
is even processed. So, by doing what you're doing, you'd be trying to
execute the contents of the ASPX file using asp.dll.

Ray at work
 
Could you not do it the nother way round though, i have seen code for
including an asp page in an aspx page ?
 
Chris,
the only way you could "include" an aspx page in a classic ASP page is by
having an IFRAME in the ASP page whose source is the aspx page. You can
control borders, width etc to make it look like it is seamless.
Peter
 
Back
Top