From 9c7eea0ff46eafc3be94c55da337eec7230d8973 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AC=A7=E9=98=B3=E4=B9=BE?= <1517721417@qq.com> Date: Sun, 29 Dec 2024 22:06:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=AC=A7=E9=98=B3=E4=B9=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../1226.md" | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 "\346\254\247\351\230\263\344\271\276/1226.md" diff --git "a/\346\254\247\351\230\263\344\271\276/1226.md" "b/\346\254\247\351\230\263\344\271\276/1226.md" new file mode 100644 index 0000000..f5186ce --- /dev/null +++ "b/\346\254\247\351\230\263\344\271\276/1226.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