如何在asp.net中使用asp页面

时间:2022-12-02 10:08:55

I want to use asp page in my asp.net application without any modification in asp pages.

我想在我的asp.net应用程序中使用asp页面而不对asp页面进行任何修改。

further I want to add master page in my .net application.So i need the changes to be reflected in the asp page also.

进一步我想在我的.net应用程序中添加母版页。所以我需要将更改反映在asp页面中。

is it possible....any how? or any alternative to use this..?

它有可能....任何方式?或任何替代使用此..?

pls suhggest me .....thanx in advance...

请提前告诉我..... thanx ...

5 个解决方案

#1


ASP does not have master pages, so you can't use them. The most sensible thing to do is to rewrite the ASP page in ASP.NET, while there are still people around who understand what the ASP page was meant to do. There will otherwise come a time when nobody understands that page.

ASP没有母版页,因此您无法使用它们。最明智的做法是在ASP.NET中重写ASP页面,同时仍然有人了解ASP页面的用途。否则会有人无法理解该页面。

The closest thing I've seen to what you're looking for is to write an ASP.NET page that refers to the ASP page through an IFRAME. The ASP.NET page can be a content page, referring to the master page, and the ASP page can stay the same.

我所看到的最接近你正在寻找的是编写一个通过IFRAME引用ASP页面的ASP.NET页面。 ASP.NET页面可以是内容页面,指的是主页面,ASP页面可以保持不变。

#2


Classic ASP files run without any problems in a ASP.NET website. As soon as you want to mix classic ASP and ASP.NET functionality in one file you will get errors. Applying master pages to classic ASP files can't be done.

经典ASP文件在ASP.NET网站中运行没有任何问题。只要您想在一个文件中混合使用经典ASP和ASP.NET功能,就会出现错误。无法将母版页应用于经典ASP文件。

[EDIT]
An alternative could be to rewrite the functionality of the ASP pages into ASP.NET. There is a SO question about tools for converting from ASP to ASP.NET here.

[编辑]另一种方法是将ASP页面的功能重写为ASP.NET。关于在这里从ASP转换到ASP.NET的工具有一个问题。

#3


i have used asp and asp.net vb together when i was learning my method was to use jquery to put my asp classic generated html into designated divs... as my leaning increased i needed to use this method less and less its a great way to pick up asp.net C# when moving from a VB background when you dont really have time to learn, like at work.

当我学习我的方法时,我一直使用asp和asp.net vb是使用jquery将我的asp经典生成的html放入指定的div中...随着我的倾向增加我需要使用这种方法越来越少它的一个好方法当你没有时间学习时,比如在工作中从VB背景移动时,选择asp.net C#。

#4


I think there are thousands of developers that wish for the same thing!

我想有成千上万的开发者希望同样的事情!

At my company I have to deal with this a LOT as we have some large systems written entirely in Classic ASP, some written entirely in ASP.NET, and some that are hybrid solutions.

在我的公司,我必须解决这个问题,因为我们有一些完全用Classic ASP编写的大型系统,有些完全用ASP.NET编写,有些是混合解决方案。

Depending on your environment the two can coexist peacefully as long as you don't need to share session state between the two. If you need that, there are a few solutions out there for storing the sessions in a database, but none are very elegant.

根据您的环境,只要您不需要在两者之间共享会话状态,两者就可以和平共存。如果您需要,可以使用一些解决方案将会话存储在数据库中,但没有一个非常优雅。

Your best bet would be to make a few ASP include files to build a similar look and feel to your Master page, and apply it to your Classic ASP pages until you have the time to rewrite them.

您最好的选择是制作一些ASP包含文件,以便为您的母版页构建类似的外观,并将其应用到您的经典ASP页面,直到您有时间重写它们为止。

Also, if you have a lot of business logic that you need to share between the two systems, you can take your DLLs and wrap them in COM so your ASP pages can use them too.

此外,如果您需要在两个系统之间共享许多业务逻辑,则可以使用DLL并将它们包装在COM中,以便ASP页面也可以使用它们。

#5


A dirty way: Make a HTTP request from the ASP.NET code to the .asp page and store the response in a web control. It's not pretty, but it works.

脏方法:从ASP.NET代码向.asp页面发出HTTP请求,并将响应存储在Web控件中。它不漂亮,但它的工作原理。

#1


ASP does not have master pages, so you can't use them. The most sensible thing to do is to rewrite the ASP page in ASP.NET, while there are still people around who understand what the ASP page was meant to do. There will otherwise come a time when nobody understands that page.

ASP没有母版页,因此您无法使用它们。最明智的做法是在ASP.NET中重写ASP页面,同时仍然有人了解ASP页面的用途。否则会有人无法理解该页面。

The closest thing I've seen to what you're looking for is to write an ASP.NET page that refers to the ASP page through an IFRAME. The ASP.NET page can be a content page, referring to the master page, and the ASP page can stay the same.

我所看到的最接近你正在寻找的是编写一个通过IFRAME引用ASP页面的ASP.NET页面。 ASP.NET页面可以是内容页面,指的是主页面,ASP页面可以保持不变。

#2


Classic ASP files run without any problems in a ASP.NET website. As soon as you want to mix classic ASP and ASP.NET functionality in one file you will get errors. Applying master pages to classic ASP files can't be done.

经典ASP文件在ASP.NET网站中运行没有任何问题。只要您想在一个文件中混合使用经典ASP和ASP.NET功能,就会出现错误。无法将母版页应用于经典ASP文件。

[EDIT]
An alternative could be to rewrite the functionality of the ASP pages into ASP.NET. There is a SO question about tools for converting from ASP to ASP.NET here.

[编辑]另一种方法是将ASP页面的功能重写为ASP.NET。关于在这里从ASP转换到ASP.NET的工具有一个问题。

#3


i have used asp and asp.net vb together when i was learning my method was to use jquery to put my asp classic generated html into designated divs... as my leaning increased i needed to use this method less and less its a great way to pick up asp.net C# when moving from a VB background when you dont really have time to learn, like at work.

当我学习我的方法时,我一直使用asp和asp.net vb是使用jquery将我的asp经典生成的html放入指定的div中...随着我的倾向增加我需要使用这种方法越来越少它的一个好方法当你没有时间学习时,比如在工作中从VB背景移动时,选择asp.net C#。

#4


I think there are thousands of developers that wish for the same thing!

我想有成千上万的开发者希望同样的事情!

At my company I have to deal with this a LOT as we have some large systems written entirely in Classic ASP, some written entirely in ASP.NET, and some that are hybrid solutions.

在我的公司,我必须解决这个问题,因为我们有一些完全用Classic ASP编写的大型系统,有些完全用ASP.NET编写,有些是混合解决方案。

Depending on your environment the two can coexist peacefully as long as you don't need to share session state between the two. If you need that, there are a few solutions out there for storing the sessions in a database, but none are very elegant.

根据您的环境,只要您不需要在两者之间共享会话状态,两者就可以和平共存。如果您需要,可以使用一些解决方案将会话存储在数据库中,但没有一个非常优雅。

Your best bet would be to make a few ASP include files to build a similar look and feel to your Master page, and apply it to your Classic ASP pages until you have the time to rewrite them.

您最好的选择是制作一些ASP包含文件,以便为您的母版页构建类似的外观,并将其应用到您的经典ASP页面,直到您有时间重写它们为止。

Also, if you have a lot of business logic that you need to share between the two systems, you can take your DLLs and wrap them in COM so your ASP pages can use them too.

此外,如果您需要在两个系统之间共享许多业务逻辑,则可以使用DLL并将它们包装在COM中,以便ASP页面也可以使用它们。

#5


A dirty way: Make a HTTP request from the ASP.NET code to the .asp page and store the response in a web control. It's not pretty, but it works.

脏方法:从ASP.NET代码向.asp页面发出HTTP请求,并将响应存储在Web控件中。它不漂亮,但它的工作原理。