我对MVC一个很简单的问题。
I have a very simple question about MVC.
什么是真的,我为什么要注意到它。我知道这是不是替代asp,但什么是ASP.NET,我不能这样做,因此需要MVC。
What is it really and why should I notice it. I know it is not replacement for asp but What is it in ASP.NET that I cannot do and hence require MVC .
我知道google是找到一些答案的最佳途径,但我认为,如果有人在这里谁知道这真的很好可以解释我,我会非常感激。
I know google is the best way to find some answers but I thought if someone over here who knows this really well can explain me, I would be very obliged.
推荐答案ASP.NET MVC使用比web表单不同的设计模式。 MVC的目的是分开不同的关切纳入不同的层次。
ASP.NET MVC uses a different design pattern than webforms. MVC aims to separate the different concerns into different layers.
ASP.NET MVC有一些很好的东西出来的箱子你,就像脚手架(基本上你给它的数据源,并为您生成一个基本的形式)和URL重写。你可以,当然,这样做与web表单,但MVC确实开箱对你来说,这是很好的。
ASP.NET MVC has some nice things out of the box for you, like scaffolding (basically you feed it a data source and it generates a basic form for you) and URL rewriting. You can, of course, do this with webforms, but MVC does it out of the box for you, which is nice.
在ASP.NET MVC为您提供了标记的更多的控制(或者至少更容易让你标记的控制)。对于许多人来说,这是一个真正的好到有。这就是说,你也会失去一些使ASP.NET WebForms的易于使用,喜欢的ViewState的事。
In ASP.NET MVC gives you more control of the markup (or at least more easily gives you control of the markup). For many people this is a real nice-to-have. That said, you also lose some of the things that make ASP.NET webforms easy to work with, like ViewState.
另外,我想补充一点,你可以混合和匹配WebForms和MVC的,所以它不是一个全有或全无的局面。
Also, I'd like to add that you can mix and match webforms and MVC, so its not a "all or nothing" situation.
希望这有助于。
更多推荐
ASP.NET MVC VS Web表单
发布评论