Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我是 mvc3 的新手。我学习了如何在单独的视图中插入、显示和更新记录。但是我怎样才能在单一视图中完成所有这些操作呢?也就是说,用户将能够从页面顶部(视图)插入记录,还可以在页面底部看到所有记录的列表,并且还能够从同一页面(视图)进行更新。谢谢
添加一个控制器和一个单一的视图......下面是一个粗略的例子。
public ActionResult Index() { //code to display return View(); } [HttpPost] public ActionResult Index(int id) { //code to delete } [HttpPost] public ActionResult Index(int id, string name) { //code to update }