ASP.NET Web 窗体和 ASP.NET 网页

发布于 2024-11-09 22:06:01 字数 131 浏览 2 评论 0原文

ASP.NET Web 窗体和 ASP.NET 网页之间有什么区别?

这里它说网页和网络表单是不同的方法。

What is the difference between ASP.NET Web Forms and ASP.NET Web Pages?

Here it says that Web Pages and Web Forms are different approaches.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

我很坚强 2024-11-16 22:06:01

ASP.NET Full 共有三种版本,还有 ASP.NET Core(可在 Linux 和 Mac 上运行的新版本)。

对于 ASP.NET Full

第一个是最古老的,称为 Web 窗体。基本上,它是一个高级的面向组件的 Web 框架,可与封装行为和视图的按钮和网格等控件一起使用。

它是 ASP.NET 中最流行的风格,但它因缺乏对生成的标记的控制而受到批评。当前大多数新项目都是 ASP.NET MVC,但肯定有大量 Web 窗体代码。虽然这是我个人最喜欢的,但我必须指出,这是开始学习 Web 编程的一种不好的方法,因为它向您隐藏了实现细节(当您有经验时这是很好的)并且学习起来有点复杂。

来源: http://www.asp.net/web-forms

ASP.NET MVC 是一个ASP.NET 的 MVC 模式的实现。有些人声称使用单元测试和良好的关注点分离来开发可维护的应用程序比使用 Web 窗体更容易。

我不同意这一点,并认为使用 MVP 等模式可以通过 Web 表单实现相同的效果。另一方面,ASP.NET MVC 有一个很大的优势 - 它允许完全控制生成的标记。这对于现代 Web 开发风格非常重要,因为很多事情都是用 JavaScript 控制的。例如,在 MVC 视图之上添加精美的动画比在 Web 窗体之上添加更容易。

来源:http://www.asp.net/mvc

ASP.NET 网页是(当前)针对小型项目和初学者开发人员的最新风格(至少在我看来)。它非常适合开发大约 10 页的小型项目。大多数逻辑都以我所说的“基本 PHP 风格”编写在每页一个文件中。它使用 Razor 语法来注入服务器端代码。

来源: http://www.asp.net/web-pages

请注意,Web 表单使用页面(与 MVC 不同),因此人们对 ASP.NET 网页是什么感到困惑。

对于 ASP.NET Core,使用新版本的 ASP.NET MVC,其概念与上述 ASP.NET MVC 相同。有趣的是,从 ASP.NET Core 2.0 开始,还有一个名为 Razor Pages 本质上是 ASP.NET 网页的更高级版本。

There are three flavors of ASP.NET Full and there is also ASP.NET Core (the new one that works on Linux and Mac).

For ASP.NET Full

The first one is the oldest and is called Web Forms. Basically it is a high-level component-oriented web framework that works with controls like buttons and grids that encapsulate behaviour and view.

It was the most popular flavor of ASP.NET, but it has been criticised for the lack of control over the generated markup. Currently most new projects are ASP.NET MVC, but there is definitely a lot of Web Forms code out there. While this is my personal favorite, I must point out that it is a bad way to start learning web programming, because it hides the implementation details from you (which is good when you have experience) and is a bit complex to learn.

Source: http://www.asp.net/web-forms

ASP.NET MVC is an implementation of the MVC pattern for ASP.NET. Some people claim that it is easier to develop maintainable applications with unit tests and good separation of concerns with this framework than it is with Web Forms.

I disagree on this point and think that using patterns like MVP one can achieve the same with Web Forms. On the other hand, ASP.NET MVC has one big advantage - it allows full control over the generated markup. This is very important for the modern style of web development where a lot of things are controlled with JavaScript. For example, adding a fancy animation is easier to do on top of an MVC view than it is on top of a Web Form.

Source: http://www.asp.net/mvc

ASP.NET Web Pages is a (currently) the latest flavor that is targeted at smaller project and beginner developers (at least in my opinion). It is good for developing smaller projects with ~ 10 pages. Most of the logic is written in a single file per page in what I call "Basic PHP style". It uses the Razor syntax for injecting the serverside code.

Source: http://www.asp.net/web-pages

Note that Web Forms uses pages (unlike MVC), and therefore there is a confusion what ASP.NET Web Pages is.

For ASP.NET Core, a new version of ASP.NET MVC is used that is conceptually the same as the ASP.NET MVC described above. Interestingly, as of ASP.NET Core 2.0, there is also something called Razor Pages which is essentially a more advanced version of ASP.NET Web Pages.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文