From 5bb3d78362e4e2355577db637723a699e2a5ae2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BB=96=E4=BB=B2=E8=BE=89?= <913445033@qq.com> Date: Sun, 4 Jan 2026 15:35:51 +0000 Subject: [PATCH 1/3] =?UTF-8?q?=E6=96=B0=E5=BB=BA=20=E5=BB=96=E4=BB=B2?= =?UTF-8?q?=E8=BE=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\345\273\226\344\273\262\350\276\211/.keep" | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 "\345\273\226\344\273\262\350\276\211/.keep" diff --git "a/\345\273\226\344\273\262\350\276\211/.keep" "b/\345\273\226\344\273\262\350\276\211/.keep" new file mode 100644 index 0000000..e69de29 -- Gitee From 2185ee20dfcda10007826a33f25f5ab6eabc7e34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BB=96=E4=BB=B2=E8=BE=89?= <913445033@qq.com> Date: Sun, 4 Jan 2026 15:37:27 +0000 Subject: [PATCH 2/3] 20260104 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 廖仲辉 <913445033@qq.com> --- ...47\345\210\266\345\231\250\347\261\273.md" | 70 +++++++++++++++++ .../20251231MVC\350\247\206\345\233\276.md" | 78 +++++++++++++++++++ ...57\347\224\261\346\250\241\346\235\277.md" | 50 ++++++++++++ 3 files changed, 198 insertions(+) create mode 100644 "\345\273\226\344\273\262\350\276\211/20251230MVC\346\216\247\345\210\266\345\231\250\347\261\273.md" create mode 100644 "\345\273\226\344\273\262\350\276\211/20251231MVC\350\247\206\345\233\276.md" create mode 100644 "\345\273\226\344\273\262\350\276\211/20260104MVC\350\267\257\347\224\261\346\250\241\346\235\277.md" diff --git "a/\345\273\226\344\273\262\350\276\211/20251230MVC\346\216\247\345\210\266\345\231\250\347\261\273.md" "b/\345\273\226\344\273\262\350\276\211/20251230MVC\346\216\247\345\210\266\345\231\250\347\261\273.md" new file mode 100644 index 0000000..193737f --- /dev/null +++ "b/\345\273\226\344\273\262\350\276\211/20251230MVC\346\216\247\345\210\266\345\231\250\347\261\273.md" @@ -0,0 +1,70 @@ +# 笔记 + +``` + +控制器类继承 +public class 名称 :Controller +每一个新的方法都需要在controller文件夹下新建一个同名文件 + +``` + + + + + + // 18. 完成如下任务 + - ## 题目描述:使用计算属性名动态创建对象属性----------------------------------------------------------------------------------------------------------------- + + ```html + let key ="score"; + let student = {[key]:85} + console.log(student); + ``` + + - ## 18 完成如下任务 题目描述: 使用 jQuery 获取 id 为 "demo" 的元素,并输出该元素的 jQuery 对象------------------------------------------------ + ```html + +
我是一个对象
+ + ``` + + ```html + +``` + + - ## 使用 jQuery 选择器选中所有偶数行的表格行,并为其添加背景色---------------------------------------------------------------------------------------- + + ```html + + + + + + +
第1行
第2行
第3行
第4行
+ +``` + + +// 第2、4行有背景色 +```html + +``` + + +``` \ No newline at end of file diff --git "a/\345\273\226\344\273\262\350\276\211/20251231MVC\350\247\206\345\233\276.md" "b/\345\273\226\344\273\262\350\276\211/20251231MVC\350\247\206\345\233\276.md" new file mode 100644 index 0000000..b2c57ca --- /dev/null +++ "b/\345\273\226\344\273\262\350\276\211/20251231MVC\350\247\206\345\233\276.md" @@ -0,0 +1,78 @@ +# 笔记 + +- 视图 +``` +是先要有一个视图文件,然后用@在主页面插入视图 + +1.视图文件 +``` +@model Product +
+

@Model.Name

+

Price: $@Model.Price

+
+``` +2. 在主页面插入视图 +主页面(如Index.cshtml)通过@Html.Partial或@await Html.PartialAsync插入视图组件: +``` +@model IEnumerable +
+ @foreach (var product in Model) + { + @await Html.PartialAsync("_Product", product) + } +
+``` + + +- ## 200题复习题 +- ## //验证jq准备完成 +```html + +``` + +// 5. 完成如下任务 + - ## 题目描述:使用 jQuery 的 .each() 方法遍历元素集合,为每个元素设置不同的内容---------------------------------------------------------------------------------------- + +```html + +
元素1
+
元素2
+
元素3
+ +``` + +```html + +``` + + +//jq事件处理 + - ## 题目描述:使用 jQuery 为按钮添加点击事件,点击时改变页面标题 + + + ```html +

原标题

+ + ``` + +```html +let $bt=$("#bt"); +$bt.click(function(){ + let t=document.getElementById("title"); + t.innerText="新标题"; +}) + +``` \ No newline at end of file diff --git "a/\345\273\226\344\273\262\350\276\211/20260104MVC\350\267\257\347\224\261\346\250\241\346\235\277.md" "b/\345\273\226\344\273\262\350\276\211/20260104MVC\350\267\257\347\224\261\346\250\241\346\235\277.md" new file mode 100644 index 0000000..cdbaa90 --- /dev/null +++ "b/\345\273\226\344\273\262\350\276\211/20260104MVC\350\267\257\347\224\261\346\250\241\346\235\277.md" @@ -0,0 +1,50 @@ +# 笔记 + +``` +// 默认路由模板配置 +app.MapControllerRoute( + name: "default", + pattern: "{controller=Home}/{action=Index}/{id?}"); +``` + +- ## 200题练习 +- ## 题目描述: 使用 jQuery 的 .hover() 方法为元素添加鼠标悬停效果 +// - HTML 结构: +// ```html +//
悬停我
+// ``` + - ## 输出示例: 鼠标悬停时背景变色,离开时恢复 + - +``` + +
悬停我
+ +``` + +``` +let $box=$("#box"); +$box.hover(function(){ + $box.css("background-color","red"); +},function(){ + $box.css("background-color","grey") +}) +$box.fadeOut +``` + + - ## 题目描述:使用 jQuery 事件委托,为动态添加的列表项添加点击事件 + + ```html + + + ``` + + +```html +let count=2; +$("#addBtn").click(function(){ + $("#list").append("
  • 项目"+count+"
  • "); + count++; +}) +``` -- Gitee From f0f47a891b325b4bbbbd331fe06e53c1cf0d185b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BB=96=E4=BB=B2=E8=BE=89?= <913445033@qq.com> Date: Sun, 11 Jan 2026 16:11:58 +0000 Subject: [PATCH 3/3] 1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 廖仲辉 <913445033@qq.com> --- .../20260105MVC\350\267\257\347\224\261.md" | 9 +++++ ...72\346\234\254\346\265\201\347\250\213.md" | 36 +++++++++++++++++++ ...76\347\261\273\350\241\245\345\205\205.md" | 10 ++++++ ...07\347\255\276\345\212\251\346\211\213.md" | 18 ++++++++++ 4 files changed, 73 insertions(+) create mode 100644 "\345\273\226\344\273\262\350\276\211/20260105MVC\350\267\257\347\224\261.md" create mode 100644 "\345\273\226\344\273\262\350\276\211/20260107MVC\345\273\272\347\253\213\345\237\272\346\234\254\346\265\201\347\250\213.md" create mode 100644 "\345\273\226\344\273\262\350\276\211/20260108MVC\350\247\206\345\233\276\347\261\273\350\241\245\345\205\205.md" create mode 100644 "\345\273\226\344\273\262\350\276\211/20260109MVC\346\240\207\347\255\276\345\212\251\346\211\213.md" diff --git "a/\345\273\226\344\273\262\350\276\211/20260105MVC\350\267\257\347\224\261.md" "b/\345\273\226\344\273\262\350\276\211/20260105MVC\350\267\257\347\224\261.md" new file mode 100644 index 0000000..9b24310 --- /dev/null +++ "b/\345\273\226\344\273\262\350\276\211/20260105MVC\350\267\257\347\224\261.md" @@ -0,0 +1,9 @@ +# 笔记 + + +路由要在视图view文件夹下新建一个页面‌路由(Routing)‌: + +‌功能‌:解析URL并分发请求到控制器和动作方法。 +‌位置‌:路由规则通常在App_Start文件夹中的RouteConfig.cs(如RegisterRoutes方法)定义,与视图文件夹无关。 +``` \ No newline at end of file diff --git "a/\345\273\226\344\273\262\350\276\211/20260107MVC\345\273\272\347\253\213\345\237\272\346\234\254\346\265\201\347\250\213.md" "b/\345\273\226\344\273\262\350\276\211/20260107MVC\345\273\272\347\253\213\345\237\272\346\234\254\346\265\201\347\250\213.md" new file mode 100644 index 0000000..b9ed563 --- /dev/null +++ "b/\345\273\226\344\273\262\350\276\211/20260107MVC\345\273\272\347\253\213\345\237\272\346\234\254\346\265\201\347\250\213.md" @@ -0,0 +1,36 @@ +# 笔记 + +``` +ctrl+`调出终端 +dotnet new mvc -n 项目名称 +建立项目后 +在主仓库同级路径新建readme.md文件 (跑:doenet watch git add. 存档) +在控制器file里新建控制类文件 +1.命名空间 namespace 上上级.上级 +2.新建类时需要继承控制类 :controller +在新建的控制类文件中需要建立视图函数,IActionResult如果是首页视图则命名为View. +然后return View() + +接着在视图file里也要新建视图文件夹,用控制器的前缀名称.再新建文件.cshtml(和视图函数同名) +视图文件内部初始内容: +@{ + Layout=null; +} + +从控制器向视图传递数据的三种方法 +1.ViewData (ViewDate['title']='女侠榜') +2,ViewBag (ViewBag.Nickname='过儿') +3.强关联数据; + +在Modles的文件夹里定义新girl项专门用来定义属性 +public 数据类型 名字{get;set}=null!不可为空 +public 数据类型?名称{get;set}可为空; +``` + +## 效果图 + + +## 源代码 +```html + +``` \ No newline at end of file diff --git "a/\345\273\226\344\273\262\350\276\211/20260108MVC\350\247\206\345\233\276\347\261\273\350\241\245\345\205\205.md" "b/\345\273\226\344\273\262\350\276\211/20260108MVC\350\247\206\345\233\276\347\261\273\350\241\245\345\205\205.md" new file mode 100644 index 0000000..4cdd2db --- /dev/null +++ "b/\345\273\226\344\273\262\350\276\211/20260108MVC\350\247\206\345\233\276\347\261\273\350\241\245\345\205\205.md" @@ -0,0 +1,10 @@ +# 笔记 +``` +model里定义类型 +不可为空: +public 数据类型 名字{get;set;}=null!不可为空 +publilc数据类型?名字{get:set;}可为空 + + +强类型想在视图指定需要 @ 类型,如List +``` \ No newline at end of file diff --git "a/\345\273\226\344\273\262\350\276\211/20260109MVC\346\240\207\347\255\276\345\212\251\346\211\213.md" "b/\345\273\226\344\273\262\350\276\211/20260109MVC\346\240\207\347\255\276\345\212\251\346\211\213.md" new file mode 100644 index 0000000..9cbea43 --- /dev/null +++ "b/\345\273\226\344\273\262\350\276\211/20260109MVC\346\240\207\347\255\276\345\212\251\346\211\213.md" @@ -0,0 +1,18 @@ +# 笔记 +``` +可以用@{}在视图页面直接做控制页面的配置,写c#代码 + + +@using使用命名空间 +@model类型 指定使用类型模型 +@if(){ + +} +可以直接用c#操控引用变量 + +Taghelps MVC标签助手 帮助拿到数据提交到页面 +超链接跳转 + +可以用httpget指定页面方晖函数 +可以用httppost指定表单提交函数避免程序混乱 +``` \ No newline at end of file -- Gitee