关于视图的一些一些一些html
1、Action指定使用视图spa
public ActionResult Add(string txtName, string txtContent) { return View("Index"); return View("~/Views/Default/BackDemo.cshtml") return View(); }
2、Action向View传递数据code
主要有四种ViewData、ViewBag和Model和TempData,其中ViewData和ViewBag共享数据。TempData和其余不共享htm
3、调用另外一个视图(RenderPartial)blog
记录一下,@{HTML.RenderPartial("~/View/Home/List.cshtml"); },这样能够直接调用另外一个页面的HTML。string
若是想在调用的这个页面进行传递参数,能够在父页面,用ViewData将参数传入,而后再调用。例如这样io
ViewData["Test"] = "ccx"; @{HTML.RenderPartial("~/View/Home/List.cshmtl"); }