Can you include .aspx pages within classic ASP pages?

Have a server running classic ASP and .NET websites.

Have one particular website that is all classic ASP.

Developing new sections to this in .NET - they will be standalone, but 'part' of the site.

There may be some functionality from the new .NET site that I would like to use in the ASP site.  Can i simply include an .aspx page to run that .NET code in the same way that I include other ASP or HTML pages?

In other words, with IIS process the .aspx using the .NET runtime, and the main ASP page as normal, or will it include the contents of the .aspx then process all that as ASP and crash.

I think that explains what I may want to do!
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

b0lsc0ttIT ManagerCommented:

It should crash.  The include in ASP adds the code and then processes the "lump" of code.  Include files aren't processed first and then added.  This would cause errors since the ASP engine would attempt to process your ASP.NET code.

Let me know if you have any questions or need more information.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
You could try an Iframe, I know its not ideal, but many times .net apps will work fine in an Iframe.  

Just be aware that you may have issues with ajax, cookies, sessionstate etc.  

And the code would not be interactive with the asp page, just displayed within it.

Just have to try and see.

Beyond that if you just want to call .net code from within asp, there are ways to do this. One straight forward example can be found here:
RynertAuthor Commented:
Thanks for the answer and alternative suggestions - I think I will just have to code the bits I want to use on the old site, the old way!
b0lsc0ttIT ManagerCommented:
Your welcome!  I'm glad I could help.  Thanks for the grade, the points and the fun question.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.