admin管理员组文章数量:1414628
I am building an MVC 2 web app, where I want to display information about something (the parent) as well as child details which are displayed as rows (children have a many to one relationship to the parent).
I have implemented AJAX in MVC before using Ajax.BeginForm and partial views Using this method - with minor changes for MVC 2 release.
I want to add the ability to edit child rows inline using ajax, but I would like to know how others implement this. Are there facilities in MVC that can do this?
I am building an MVC 2 web app, where I want to display information about something (the parent) as well as child details which are displayed as rows (children have a many to one relationship to the parent).
I have implemented AJAX in MVC before using Ajax.BeginForm and partial views Using this method - with minor changes for MVC 2 release.
I want to add the ability to edit child rows inline using ajax, but I would like to know how others implement this. Are there facilities in MVC that can do this?
Share Improve this question edited Oct 14, 2010 at 21:06 mare 13.1k24 gold badges106 silver badges193 bronze badges asked Oct 14, 2010 at 20:17 JeremyJeremy 46.5k72 gold badges214 silver badges355 bronze badges 1- No, nothing in MVC. How is an "inline" edit different from what you describe with partial views? – bzlm Commented Oct 14, 2010 at 20:49
2 Answers
Reset to default 3Have a look at this post here. From what you're describing it's exactly what you need for your scenario. You can not only edit items inline but also add/remove item dynamically.
This is more of a requirement for Javascript plugin or library than ASP.NET MVC..
If you want the behaviour where you click on link and get into edit mode (like replace text with textbox) take a look at Jeditable.
Though I don't use it, I just create (for example, in a table) one row with fixed text and another with textboxes and then hide the one with textboxes and I only display it when user click on Edit link. I have a save link in the edit row and when this is clicked I just hide the edit row. I post the data using regular form post not ajax post.
本文标签: javascriptASPNET MVC Inline EditStack Overflow
版权声明:本文标题:javascript - ASP.NET MVC Inline Edit - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745168206a2645811.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论