Steve Zaj
Steve Zaj

Reputation:

Including an asp vb page in an aspx c# page

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

Upvotes: 2

Views: 3284

Answers (3)

jdecuyper
jdecuyper

Reputation: 3963

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.

Upvotes: 0

Justin Niessner
Justin Niessner

Reputation: 245479

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.

Upvotes: 1

Mehrdad Afshari
Mehrdad Afshari

Reputation: 422182

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

Upvotes: 1

Related Questions