MVC加深理解

MVC

MVC约定:Controllers文件夹 对应 Views文件夹;所有子文件的名称一一对应。

页面请求 -> 路由 -> 找到 controller/action -> return View() 回到相应页面

 

相同controller下,(action)Index 返回其他(view)list。不经过(action) list,直接返回 (view)list

捷径:(action)Index -> return  View("list")

 

转到其他controller方法

return RedirectToRoute(new { controller = "User", action = "Balance" });
return new RedirectResult("/user/index");

 

action -> action

RedirectToAction("Index");  //转到 "Index" Action

posted @ 2019-05-07 10:17  blog_zhaof  阅读(147)  评论(0编辑  收藏  举报