Including ASPX page in Classic ASP page?

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
 
R

Ray Costanzo [MVP]

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
 
G

Guest

Could you not do it the nother way round though, i have seen code for
including an asp page in an aspx page ?
 
J

Juan T. Llibre

Given that ASP and ASPX are handled by different ISAPI applications, no.
That is not possible.
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top