• <tfoot id='rXapK'></tfoot>
    1. <legend id='rXapK'><style id='rXapK'><dir id='rXapK'><q id='rXapK'></q></dir></style></legend>
    2. <small id='rXapK'></small><noframes id='rXapK'>

      <i id='rXapK'><tr id='rXapK'><dt id='rXapK'><q id='rXapK'><span id='rXapK'><b id='rXapK'><form id='rXapK'><ins id='rXapK'></ins><ul id='rXapK'></ul><sub id='rXapK'></sub></form><legend id='rXapK'></legend><bdo id='rXapK'><pre id='rXapK'><center id='rXapK'></center></pre></bdo></b><th id='rXapK'></th></span></q></dt></tr></i><div id='rXapK'><tfoot id='rXapK'></tfoot><dl id='rXapK'><fieldset id='rXapK'></fieldset></dl></div>
          <bdo id='rXapK'></bdo><ul id='rXapK'></ul>

        为什么 Razor Pages 是在 Asp.net Core 中创建 Web UI 的推荐方法?

        时间:2023-07-11
        1. <i id='UU41g'><tr id='UU41g'><dt id='UU41g'><q id='UU41g'><span id='UU41g'><b id='UU41g'><form id='UU41g'><ins id='UU41g'></ins><ul id='UU41g'></ul><sub id='UU41g'></sub></form><legend id='UU41g'></legend><bdo id='UU41g'><pre id='UU41g'><center id='UU41g'></center></pre></bdo></b><th id='UU41g'></th></span></q></dt></tr></i><div id='UU41g'><tfoot id='UU41g'></tfoot><dl id='UU41g'><fieldset id='UU41g'></fieldset></dl></div>
          • <bdo id='UU41g'></bdo><ul id='UU41g'></ul>

            <tfoot id='UU41g'></tfoot>
          • <small id='UU41g'></small><noframes id='UU41g'>

            • <legend id='UU41g'><style id='UU41g'><dir id='UU41g'><q id='UU41g'></q></dir></style></legend>

                    <tbody id='UU41g'></tbody>

                • 本文介绍了为什么 Razor Pages 是在 Asp.net Core 中创建 Web UI 的推荐方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  学习新事物需要时间、空间和精力的投入.我目前正在学习 Asp.Net Core MVC 2.0.此ASP.NET Core 教程概述 指出:

                  Learning new things needs an investment of time, space and energy. I am currently learning Asp.Net Core MVC 2.0. This ASP.NET Core tutorials overview states:

                  Razor Pages 是使用 ASP.NET Core 创建 Web UI 的推荐方法

                  Razor Pages is the recommended approach to create a Web UI with ASP.NET Core

                  这些信息让我在决定是否必须停止学习 Asp.net Core MVC 并开始学习 Asp.net Core Razor Pages 时感到困惑.

                  This information confused me in deciding whether I have to stop learning Asp.net Core MVC and start learning Asp.net Core Razor Pages.

                  • 为什么推荐使用 Razor Pages 在 Asp.net Core 中创建 Web UI?

                  欢迎任何方向.

                  推荐答案

                  Razor 页面针对基于页面的工作流进行了优化,并且可以在这些场景中使用,其移动部件比传统 MVC 模型少.这是因为您不需要处理控制器、操作、路由、视图模型和视图(就像您通常那样).相反,您的路线是基于约定的,并且您的 PageModel 可作为您的 Controller、Action(s) 和 ViewModel 合而为一.当然,页面取代了视图.您也不必像在 MVC 中那样拥有那么多文件夹,从而进一步简化您的项目.

                  Razor Pages are optimized for page-based workflows and can be used in these scenarios with fewer moving parts than traditional MVC models. This is because you don't need to deal with Controllers, Actions, Routes, ViewModels, and Views (as you typically would). Instead your route is convention-based, and your PageModel serves as your Controller, Action(s), and ViewModel all in one. The page, of course, replaces the View. You also don't have to have as many folders as you would in MVC, further simplifying your project.

                  来自 ASP.NET Core - 使用 Razor 页面的更简单的 ASP.NET MVC 应用程序,2017 年 9 月 MSDN 文章,作者 Steve Smith:

                  From ASP.NET Core - Simpler ASP.NET MVC Apps with Razor Pages, a Sept. 2017 MSDN article by Steve Smith:

                  [Razor Pages] 提供

                  [Razor Pages] provide

                  • 在 ASP.NET Core 应用程序中组织代码的更简单方法,使实现逻辑和视图模型更接近视图实现代码.
                  • 它们还提供了一种更简单的方式来开始开发 ASP.NET Core 应用程序,

                  那篇文章提供了有关为什么将 Razor Pages over MVC 用于基于页面的工作流的更多信息.显然,对于 API,您仍然希望使用控制器.

                  That article has more information on why to use Razor Pages over MVC for page-based workflows. Obviously, for APIs, you will still want to use Controllers.

                  ASP.NET Core - ASP.NET Core MVC 的功能切片,2016 年 9 月的一篇较早的 MSDN 文章描述了为什么用于组织视图和控制器的经典 MVC 约定可能对大型项目不利.本文给出了四个松散相关的应用程序概念的示例:忍者、植物、海盗和僵尸.本文概述了一种在默认文件夹约定之外构建它们的方法,方法是按功能或责任区域将文件组织到文件夹中.

                  ASP.NET Core - Feature Slices for ASP.NET Core MVC, an older MSDN article from Sept. 2016, describes why the classical MVC convention to organize views and controller might have disadvantages for larger projects. The article gives an example of four loosely related application concepts: Ninjas, Plants, Pirates and Zombies. The article outlines a way to structure them outside of the default folder convention by organizing files into folders by feature or area of responsibility.

                  这篇关于为什么 Razor Pages 是在 Asp.net Core 中创建 Web UI 的推荐方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:ASPNET Core 服务器发送事件/响应刷新 下一篇:ASP.NET MVC 6 和 ASP.NET Core 1.0 有什么区别以及核心框架背后的原因?

                  相关文章

                  <tfoot id='v9zi5'></tfoot>

                • <i id='v9zi5'><tr id='v9zi5'><dt id='v9zi5'><q id='v9zi5'><span id='v9zi5'><b id='v9zi5'><form id='v9zi5'><ins id='v9zi5'></ins><ul id='v9zi5'></ul><sub id='v9zi5'></sub></form><legend id='v9zi5'></legend><bdo id='v9zi5'><pre id='v9zi5'><center id='v9zi5'></center></pre></bdo></b><th id='v9zi5'></th></span></q></dt></tr></i><div id='v9zi5'><tfoot id='v9zi5'></tfoot><dl id='v9zi5'><fieldset id='v9zi5'></fieldset></dl></div>
                • <legend id='v9zi5'><style id='v9zi5'><dir id='v9zi5'><q id='v9zi5'></q></dir></style></legend>

                    • <bdo id='v9zi5'></bdo><ul id='v9zi5'></ul>

                      <small id='v9zi5'></small><noframes id='v9zi5'>