From 9b5cf32efbf9316bf400e945892a0bf4d561c47c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E9=B8=BF=E9=9B=AF?= <3202800051@qq.com> Date: Sun, 29 Dec 2024 20:00:20 +0800 Subject: [PATCH] 1226 --- ...31\346\220\234\347\264\242\345\200\274.md" | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 "\350\214\203\351\270\277\351\233\257/20241226-\346\220\234\347\264\242\346\241\206\344\277\235\347\225\231\346\220\234\347\264\242\345\200\274.md" diff --git "a/\350\214\203\351\270\277\351\233\257/20241226-\346\220\234\347\264\242\346\241\206\344\277\235\347\225\231\346\220\234\347\264\242\345\200\274.md" "b/\350\214\203\351\270\277\351\233\257/20241226-\346\220\234\347\264\242\346\241\206\344\277\235\347\225\231\346\220\234\347\264\242\345\200\274.md" new file mode 100644 index 0000000..cf6d210 --- /dev/null +++ "b/\350\214\203\351\270\277\351\233\257/20241226-\346\220\234\347\264\242\346\241\206\344\277\235\347\225\231\346\220\234\347\264\242\345\200\274.md" @@ -0,0 +1,22 @@ +## 搜索框保留搜索值 +### Model +```c# +public class SearchViewModel +{ + public string SearchTerm{get;set;} +} +``` +### Controller +```c# +[HttpPost] +public IActionResult Search(SearchViewModel model) +{ + return View(model); +} +``` +## View +```html +
+ +
+``` -- Gitee