tags:

views:

1038

answers:

4

Can I have an aspx page written with a C# code behind file. And include an asp page with code written in vb?

+1  A: 

Yes, you can have an ASP.NET C# page with VB.NET codebehind. You cannot have classic ASP VBScript page included using <!--# include -->.

Mehrdad Afshari
A: 

Okay, I'll bite... why? I can see that if you included an iframe or layer you could 'include' an ASP page that way but it's still comes back to the 'why' as there's undoubtedly a better solution that's driven from there.

Lazarus
Customer is currently using asp classic, we're developing a new solution, and I in no way want to develop the whole thing in classic. Their site is huge, therefore I was hoping to put in new code, but still use their include files (for navigation and headers etc.)
+1  A: 

No. You've got two options:

1) Code the aspx page in C# and drop an iframe on the aspx page. Use that iframe to load the asp page completely separately from the aspx page.

2) Make the asp page return only the markup you need on your aspx page rather than a whole page. You can then put an empty div on your aspx page and use AJAX to request the asp content and render it on the aspx page.

Both options have specific drawbacks. The first results in a page that isn't easily crawled and indexed by search engines. With the second, your asp page isn't going to easily be able to process any post back data.

Justin Niessner
A: 

It's possible to include asp code inside your aspx file. But you could use an iframe pointing to an asp file and have it called from your aspx file.

jdecuyper