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 0000000000000000000000000000000000000000..f5186cefb742d76a4f5162f5b124b744765773e0 --- /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