在aspx c#页面中包含一个asp vb页面

时间:2021-08-22 02:02:46

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

我可以使用C#代码后面的文件编写aspx页面。并包含一个用vb编写的代码的asp页面?

3 个解决方案

#1


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

是的,你可以拥有一个带有VB.NET代码隐藏的ASP.NET C#页面。您不能使用 包含经典的ASP VBScript页面。

#2


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.

1)在C#中编写aspx页面并在aspx页面上删除iframe。使用该iframe将asp页面与aspx页面完全分开加载。

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.

2)使asp页面仅返回aspx页面上所需的标记而不是整页。然后,您可以在aspx页面上放置一个空div,并使用AJAX请求asp内容并在aspx页面上呈现它。

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.

两种选择都有特定的缺点。第一个结果是页面不容易被搜索引擎抓取并编入索引。第二,您的asp页面无法轻松处理任何回发数据。

#3


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.

可以在aspx文件中包含asp代码。但是你可以使用指向asp文件的iframe并从你的aspx文件中调用它。

#1


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

是的,你可以拥有一个带有VB.NET代码隐藏的ASP.NET C#页面。您不能使用 包含经典的ASP VBScript页面。

#2


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.

1)在C#中编写aspx页面并在aspx页面上删除iframe。使用该iframe将asp页面与aspx页面完全分开加载。

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.

2)使asp页面仅返回aspx页面上所需的标记而不是整页。然后,您可以在aspx页面上放置一个空div,并使用AJAX请求asp内容并在aspx页面上呈现它。

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.

两种选择都有特定的缺点。第一个结果是页面不容易被搜索引擎抓取并编入索引。第二,您的asp页面无法轻松处理任何回发数据。

#3


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.

可以在aspx文件中包含asp代码。但是你可以使用指向asp文件的iframe并从你的aspx文件中调用它。