From e6bc1f913324bc0343b6c88e7665e59ee831061f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=AB=A5=E5=AE=89=E7=90=AA?= <2689553517@qq.com> Date: Sun, 29 Dec 2024 21:29:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...42\346\241\206\344\277\235\347\225\231.md" | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 "\347\253\245\345\256\211\347\220\252/20241226-\346\220\234\347\264\242\346\241\206\344\277\235\347\225\231.md" diff --git "a/\347\253\245\345\256\211\347\220\252/20241226-\346\220\234\347\264\242\346\241\206\344\277\235\347\225\231.md" "b/\347\253\245\345\256\211\347\220\252/20241226-\346\220\234\347\264\242\346\241\206\344\277\235\347\225\231.md" new file mode 100644 index 0000000..f5186ce --- /dev/null +++ "b/\347\253\245\345\256\211\347\220\252/20241226-\346\220\234\347\264\242\346\241\206\344\277\235\347\225\231.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 +
+``` \ No newline at end of file -- Gitee