ASP.NET MVC模式对话框/弹出最佳实践 [英] ASP.NET MVC modal dialog/popup best practice
问题描述
我要寻找最标准的方式来实现在ASP.NET MVC模式对话框。
I am looking for the most standard way to achieve modal dialogs in ASP.NET MVC.
的什么,我试图做一个例子是,当我选择我的列表页面中的项目,我想在详细信息页面将超过清单的弹出而不是一个新的一页。我不是在寻找一个黑客。我希望它是后面的ASP.NET MVC模式的解决方案。我还要preFER不是踩着外面jQuery和ASP.NET AJAX(没有插件,除非它是一种新兴的最佳实践)。
An example of what I am trying to do is when I select an item from my "list" page, I want the "details" page to be a popup over the list and NOT a new page. I'm not looking for a hack. I want it to be a solution that follows the ASP.NET MVC pattern. I would also prefer not stepping outside jQuery and ASP.NET Ajax (no plugins UNLESS it is emerging as a best practice).
推荐答案
Lunchy的对话建议是好的。只要一个Ajax请求你的控制器动作并有动作返回要显示什么,喜欢用一些HTML格式的局部视图。然后,把那个HTML到您的对话框,或任何你计划显示,并显示它。
Lunchy's dialog suggestion is nice. Just make an ajax request to your controller action and have the action return what you want to display, like a partial view with some formatting html. Then, put that html into your dialog, or whatever you plan to display, and show it.
这篇关于ASP.NET MVC模式对话框/弹出最佳实践的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!