diff --git "a/\345\274\240\346\234\210\346\241\202/\344\275\234\344\270\232/10\344\270\252\347\275\221\347\253\231.md" "b/\345\274\240\346\234\210\346\241\202/\344\275\234\344\270\232/10\344\270\252\347\275\221\347\253\231.md" new file mode 100644 index 0000000000000000000000000000000000000000..b4cd42b247c298f48f845d9297c734bacb18c58c --- /dev/null +++ "b/\345\274\240\346\234\210\346\241\202/\344\275\234\344\270\232/10\344\270\252\347\275\221\347\253\231.md" @@ -0,0 +1,10 @@ +![Linux6.1](https://sgqt.oss-cn-hangzhou.aliyuncs.com/Linux6.1.png) +![Linux6.2](https://sgqt.oss-cn-hangzhou.aliyuncs.com/Linux6.2.png) +![Linux6.3](https://sgqt.oss-cn-hangzhou.aliyuncs.com/Linux6.3.png) +![Linux6.4](https://sgqt.oss-cn-hangzhou.aliyuncs.com/Linux6.4.png) +![Linux6.5](https://sgqt.oss-cn-hangzhou.aliyuncs.com/Linux6.5.png) +![Linux6.6](https://sgqt.oss-cn-hangzhou.aliyuncs.com/Linux6.6.png) +![Linux6.7](https://sgqt.oss-cn-hangzhou.aliyuncs.com/Linux6.7.png) +![Linux6.8](https://sgqt.oss-cn-hangzhou.aliyuncs.com/Linux6.8.png) +![Linux6.9](https://sgqt.oss-cn-hangzhou.aliyuncs.com/Linux6.9.png) +![Linux6.10](https://sgqt.oss-cn-hangzhou.aliyuncs.com/Linux6.10.png) diff --git "a/\345\274\240\346\234\210\346\241\202/\344\275\234\344\270\232/xuanran2.png" "b/\345\274\240\346\234\210\346\241\202/\344\275\234\344\270\232/xuanran2.png" new file mode 100644 index 0000000000000000000000000000000000000000..62858acea949f29dea4d85a79fd9fc613aba1361 Binary files /dev/null and "b/\345\274\240\346\234\210\346\241\202/\344\275\234\344\270\232/xuanran2.png" differ diff --git "a/\345\274\240\346\234\210\346\241\202/\344\275\234\344\270\232/\346\270\262\346\237\2235\351\242\230.md" "b/\345\274\240\346\234\210\346\241\202/\344\275\234\344\270\232/\346\270\262\346\237\2235\351\242\230.md" new file mode 100644 index 0000000000000000000000000000000000000000..d3d0324defe74fe7b00dbf0f30dc7b46bb0a3036 --- /dev/null +++ "b/\345\274\240\346\234\210\346\241\202/\344\275\234\344\270\232/\346\270\262\346\237\2235\351\242\230.md" @@ -0,0 +1,5 @@ +![1](https://sgqt.oss-cn-hangzhou.aliyuncs.com/1.png) +![2](https://sgqt.oss-cn-hangzhou.aliyuncs.com/2.png) +![3](https://sgqt.oss-cn-hangzhou.aliyuncs.com/3.png) +![4](https://sgqt.oss-cn-hangzhou.aliyuncs.com/4.png) +![5](https://sgqt.oss-cn-hangzhou.aliyuncs.com/5.png) \ No newline at end of file diff --git "a/\345\274\240\346\234\210\346\241\202/\347\254\224\350\256\260/20241126mvc\347\254\224\350\256\260.md" "b/\345\274\240\346\234\210\346\241\202/\347\254\224\350\256\260/20241126mvc\347\254\224\350\256\260.md" new file mode 100644 index 0000000000000000000000000000000000000000..36544ca3507731fe786548423c9bfd3f90a32723 --- /dev/null +++ "b/\345\274\240\346\234\210\346\241\202/\347\254\224\350\256\260/20241126mvc\347\254\224\350\256\260.md" @@ -0,0 +1,22 @@ +## 视图模型(ViewModel): + +专为视图设计的数据结构,用于在控制器与视图之间传递数据。 + +封装与特定视图相关的数据和逻辑,确保视图代码更易于理解和维护。 + +示例:创建包含文章和评论列表的视图模型来展示文章详情页面 + + +## ViewData: + +ControllerBase的属性,类型为ViewDataDictionary,即字典结构。 + +用于在控制器向视图传递数据,以键值对形式存储。 + +数据生命周期在当前请求的视图渲染期间。 + + +控制器(Controller):充当模型和视图之间的中介。它接收来自用户的输入,更新模型的状态,并将更新的数据传递给视图进行显示。 +控制器传参 + +在ASP.NET Core MVC中,控制器通过接收用户请求来处理数据,并将处理结果传递给视图进行展示。控制器和视图之间的数据传递可以通过多种方式实现 \ No newline at end of file diff --git "a/\345\274\240\346\234\210\346\241\202/\347\254\224\350\256\260/20241128mvc\350\257\225\345\233\276\347\254\224\350\256\260.md" "b/\345\274\240\346\234\210\346\241\202/\347\254\224\350\256\260/20241128mvc\350\257\225\345\233\276\347\254\224\350\256\260.md" new file mode 100644 index 0000000000000000000000000000000000000000..ad04d778dc01d419a8980373a6f46218de8b34b0 --- /dev/null +++ "b/\345\274\240\346\234\210\346\241\202/\347\254\224\350\256\260/20241128mvc\350\257\225\345\233\276\347\254\224\350\256\260.md" @@ -0,0 +1,35 @@ +## 视图基础 + +视图的作用: + +视图是MVC架构中的V(View)部分,负责展示数据给用户。 + +它从控制器接收数据,并将其以用户友好的方式呈现出来。 + +## 视图的位置: + +在ASP.NET Core MVC项目中,视图通常存储在Views文件夹下,每个控制器对应一个子文件夹,视图文件则以.cshtml扩展名保存。 + +## 视图数据(ViewData和ViewBag) +ViewData: + +是一个字典对象,用于在控制器和视图之间传递数据。 + +它的键是字符串类型,值是对象类型。 + +由于它是弱类型的,因此在视图中使用时需要进行类型转换。 + +ViewBag: + +是ViewData的动态包装器,允许以动态属性的方式访问ViewData中的数据。 + +使用ViewBag可以使视图代码更加简洁,但同样需要注意类型安全问题。 + + +## 视图渲染和返回 + +控制器通过调用View()方法并传递视图名称和可选的视图模型来渲染视图。 + +View()方法返回一个IActionResult类型的对象,该对象表示要发送给客户端的HTTP响应。 + +视图文件被Razor视图引擎解析和渲染成HTML,然后作为HTTP响应的主体发送给客户端。 \ No newline at end of file diff --git "a/\345\274\240\346\234\210\346\241\202/\344\275\234\344\270\232/Linux\347\254\224\350\256\260.md" "b/\345\274\240\346\234\210\346\241\202/\347\254\224\350\256\260/Linux\347\254\224\350\256\260.md" similarity index 100% rename from "\345\274\240\346\234\210\346\241\202/\344\275\234\344\270\232/Linux\347\254\224\350\256\260.md" rename to "\345\274\240\346\234\210\346\241\202/\347\254\224\350\256\260/Linux\347\254\224\350\256\260.md"