ASP.NET MVC VS Web表单

编程入门 行业动态 更新时间:2024-10-28 20:20:05
本文介绍了ASP.NET MVC VS Web表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我对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表单

本文发布于:2023-05-24 08:57:41,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/218699.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:表单   NET   ASP   Web   MVC

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!