什么是ASP.NET WebForms和MVC之间的主要区别 [英] What are the key differences between ASP.NET webforms and MVC

查看:117
本文介绍了什么是ASP.NET WebForms和MVC之间的主要区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道MVC是什么,我在的WebForms工作,但我不知道MVC怎么会有那么多的不同。我猜模型背后的code会有所不同。这样才有像web表单减去后面的code和而不是在一个控制器?

I know what MVC is and I work in webforms but I don't know how MVC will be that much different. I guess the code behind model will be different. So will it be like webforms minus the code behind and instead having it in a controller?

我看到有其他相关的职位,但我没有他们解决这个问题。

I see there are other related posts but I don't they address this.

推荐答案

对于初学者来说,MVC不使用的< ASP:控制>控制在preference良好的旧标准<输入>的等等。因此,你不事件附加到获得一个code-后面就像你在ASP将执行的控制。它依赖于标准的HTTP POST做到这一点。

For starters, MVC does not use the <asp:control> controls, in preference for good old standard <input>'s and the like. Thus, you don't attach "events" to a control that get executed in a code-behind like you would in ASP. It relies on the standard http POST to do that.

它不使用视图状态的对象。

It does not use the viewstate object.

它允许更智能URL映射,虽然现在的路由命名空间已经剥离出来,不知是否可用于WebForms的?

It allows for more intelligent url mapping, though now that the Routing namespace has been spun off, I wonder if it can be used for WebForms?

这是很容易实现自动化的Web部件测试。

It is much easier to automate testing of web parts.

它允许从后端组件的UI逻辑更容易分离。

It allows for much easier separation of UI logic from the "backend" components.

这篇关于什么是ASP.NET WebForms和MVC之间的主要区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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