MVC3 是否可以在单个视图/控制器中从父模型创建模型?
所以我对 MVC 的无知日益显露出来。我有一个绑定到 [Category] 模型的视图,该模型只有一个类别表和一个允许您将 [Item] 添加到该类别的链接并尝试在 Telerik.Window 对象内显示该部分视图 ([InsertCategoryItem]) 并执行 HttpPost 或 Ajax Post 将视图模型提交到控制器并让它添加 [项目]到数据库。这可能吗?如果是这样,谁能给我一个视图和控制器应该是什么样子的精简示例?
哦,我的项目是 MVC3、SqlServerCompactEdition (4.0)、Telerik Extensions、Razor 视图
So my MVC ignorance is showing more and more each day. I have a view that is bound to a Model of [Category] which has simply a table of categories and a link that allows you to add a [Item] to that category and am attempting to display that partial view ([InsertCategoryItem]) inside a Telerik.Window object and do an HttpPost or Ajax Post to submit the view model to the controller and have it add the [Item] to the database. Is this possible? If so, can anyone give me a stripped-down example of what the View and controller should look like?
Oh, and my project is MVC3, SqlServerCompactEdition (4.0), Telerik Extensions, Razor views
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以通过使用自定义工具栏模板和网格编辑。通过结合这两个功能,您可以实现您所需要的。如果您想要自定义弹出窗口,那么您必须使用模型类型的自定义编辑器模板
You can achieve it by using custom toolbar template and grid Editing. By combining these two features you can achieve you required. If you want custom popup then you have to use custom editor template of the type of your model