简体   繁体   English

ASP.NET MVC vs 路由

[英]ASP.NET MVC vs Routing

I'm deciding between using ASP.NET MVC, or standard ASP.NET Web Forms with URL routing for my application. I'm deciding between using ASP.NET MVC, or standard ASP.NET Web Forms with URL routing for my application.

As far as I can tell, ASP.NET Web Forms with routing gives me clean URLs and I'll be able to use ASP.NET as I have been in the past. As far as I can tell, ASP.NET Web Forms with routing gives me clean URLs and I'll be able to use ASP.NET as I have been in the past. However, I've heard good things about ASP.NET MVC, which would gives native support for URL routing.但是,我听说过关于 ASP.NET MVC 的好消息,它将为 URL 路由提供本机支持。

How does the workflow from ASP.NET Web Forms differ from ASP.NET MVC? ASP.NET Web Forms 的工作流程与 Z9E0DA8438E1E38A1C30F4B76CE 有何不同? Are there any major advantages to using MVC as opposed to web forms?与 web forms 相比,使用 MVC 有什么主要优势吗?

A good place to start is here as it shows strengths and weaknesses.这里是一个很好的起点,因为它显示了优势和劣势。 There was also an article real recent in Dr Dobbs, Information Week or one of the other free mags I get that talked about when not to move to MVC.最近在 Dobbs 博士、信息周刊或我收到的其他免费杂志中也有一篇文章谈到了何时不转向 MVC。 MVC helps enforce good process with technology (at least better than webforms) and is very condusive to SEO friendly URIs. MVC 有助于通过技术(至少比 Web 表单更好)实施良好的流程,并且非常有助于 SEO 友好的 URI。

If I were biting this off, it would be MVC all the way, but I do not know your project, your team's knowledge, etc.如果我咬这个,它会一直是 MVC,但我不知道你的项目,你的团队的知识等。

Whether you ultimately decide to go with WebForms or MVC, you should definitely learn MVC either way.无论您最终决定使用 WebForms 还是 MVC,您都应该学习 MVC。 Though Microsoft has made it pretty clear that development will continue on WebForms, many (including many here) already consider it outdated.尽管微软已经明确表示将继续开发 WebForms,但许多人(包括这里的许多人)已经认为它已经过时了。 True or not, MVC likely points the way to the future of .NET web development.不管真假,MVC 很可能为 .NET web 开发的未来指明了方向。

Also, having recently finished my first MVC project after spending some time in web and windows forms, I can attest to the learning curve - and parts of it are steep.此外,最近在 web 和 windows forms 中度过了一段时间后,我完成了我的第一个 MVC 项目,我可以证明学习曲线很陡峭。 But in the end the effort pays off.但最终,努力得到了回报。 And then you'll have a personal perspective on the ups and downs and differences between the two.然后,您将对两者之间的起起落落和差异有个人看法。

I consider webforms a legacy product, mvc is a better fit for modern webdevelopment.我认为 webforms 是一种遗留产品,mvc 更适合现代 web 开发。 But...there's a learningcurve, especially when you're coming from webforms.但是...有一个学习曲线,尤其是当您来自网络表单时。 So, if time is limited, stick to what you know.所以,如果时间有限,坚持你所知道的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM