如何将ASPX页面用于MVC

时间:2022-09-21 08:23:00

As per requirement, i need to use existing/provided ASCX user controls into MVC application. As understnad, to use these controls, I have to create ASPX traditional page into MVC and then use these user controls inside the ASPX page.

根据要求,我需要将现有/提供的ASCX用户控件用于MVC应用程序。作为undertnad,要使用这些控件,我必须将ASPX传统页面创建到MVC中,然后在ASPX页面中使用这些用户控件。

I can add webform into MVC application.

我可以将webform添加到MVC应用程序中。

How can i incorporate URL for added webform ?? as it will be appear different url into the browser then other pages of MVC

如何为添加的webform合并URL?因为它会在浏览器中显示不同的URL然后是MVC的其他页面

PLease also suggest me if i have to take any other thing to incorporate traditional ASPX into MVC application.?

如果我必须采用任何其他方法将传统ASPX整合到MVC应用程序中,PLease也建议我。

Thanks

2 个解决方案

#1


3  

Actually an ASP.NET project can host Web Forms, MVC and Web API. It's just about adding the right references to the whole project. Thus, you can create traditional .aspx pages in your project.

实际上,ASP.NET项目可以托管Web窗体,MVC和Web API。它只是为整个项目添加正确的引用。因此,您可以在项目中创建传统的.aspx页面。

About "difference in URLs" when using Web Forms or MVC, this isn't longer true. Since ASP.NET 4.0, Web Forms also supports URL Routing (follow this link).

关于使用Web窗体或MVC时的“URL差异”,这不再适用。从ASP.NET 4.0开始,Web窗体也支持URL路由(请点击此链接)。

#2


2  

I use Iframe to show the aspx page in mvc like this

我使用iframe来显示像这样的mvc中的aspx页面

<iframe src="Aspx/MonitorProduct.aspx" width="1280" height="950" style="overflow:hidden;margin-top:0px;background-color:white;border:1px solid black"/>

I'm not sure is it what you want? But i hope this will help you.

我不确定你想要的是什么?但我希望这会对你有所帮助。

#1


3  

Actually an ASP.NET project can host Web Forms, MVC and Web API. It's just about adding the right references to the whole project. Thus, you can create traditional .aspx pages in your project.

实际上,ASP.NET项目可以托管Web窗体,MVC和Web API。它只是为整个项目添加正确的引用。因此,您可以在项目中创建传统的.aspx页面。

About "difference in URLs" when using Web Forms or MVC, this isn't longer true. Since ASP.NET 4.0, Web Forms also supports URL Routing (follow this link).

关于使用Web窗体或MVC时的“URL差异”,这不再适用。从ASP.NET 4.0开始,Web窗体也支持URL路由(请点击此链接)。

#2


2  

I use Iframe to show the aspx page in mvc like this

我使用iframe来显示像这样的mvc中的aspx页面

<iframe src="Aspx/MonitorProduct.aspx" width="1280" height="950" style="overflow:hidden;margin-top:0px;background-color:white;border:1px solid black"/>

I'm not sure is it what you want? But i hope this will help you.

我不确定你想要的是什么?但我希望这会对你有所帮助。