CAN"经典" ASP.NET页和微软的MVC共存于同一Web应用程序? [英] Can "classic" ASP.NET pages and Microsoft MVC coexist in the same web application?

查看:90
本文介绍了CAN"经典" ASP.NET页和微软的MVC共存于同一Web应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在想尝试MVC今天晚些时候一个新的应用我们已经开始了,但我很好奇,如果它是一个全有或全无的事情,或者我还可以聚会就像是2006年与视图状态和其他拐杖在同时...

I'm thinking about trying out MVC later today for a new app we're starting up, but I'm curious if it's an all or nothing thing or if I can still party like it's 2006 with viewstate and other crutches at the same time...

推荐答案

是的,你可以有你的Web表单页面,并在一个单一的Web应用程序项目混合MVC的意见。如果你有一个已经建立的应用程序,你想你的应用程序从web表单迁移到MVC这可能是有用的。

Yes you can have your webforms pages and MVC views mixed in a single web application project. This could be useful if you have an application that is already built and you want to migrate your app from webforms to mvc.

您需要确保没有你的Web表单页面的若干意见的目录去在一个标准的ASP.NET MVC应用程序虽然。在若干意见的目录页(或意见),不能直接通过请求的URL。

You need to make sure that none of your webforms pages go in the 'Views' directory in a standard ASP.NET MVC application though. Pages (or views) in the 'Views' directory can't be requested directly through the url.

如果您是从头开始的应用程序,将有很少的好处二者混合均匀。

If you are starting an application from scratch, there would be very little benefit to mixing the two.

这篇关于CAN"经典" ASP.NET页和微软的MVC共存于同一Web应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆