部分视图模式弹出 [英] partial view modal popup
本文介绍了部分视图模式弹出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是asp.net MVC3的新手.我给出了部分视图进行编辑.我希望将部分视图显示为模式弹出窗口,而不是在新页面中显示.请给我任何想法.请提供一些示例代码.
感谢和问候
sreekanth
I am new to asp.net MVC3. i gave partial view for edit. I want partial view to modal popup instead of displaying in new page. please give me any idea. please provide some example code.
thanks and regards
sreekanth
推荐答案
在这里,看看: ^ ]
样品,控制器:
Here, have a look: load partial view in to a modal popup[^]
Sample, Controller:
public class HomeController : Controller
{
public ActionResult Index()
{
return View();
}
public ActionResult Modal()
{
return PartialView();
}
}
然后是Modal.cshtml部分,它将包含要在模式中显示的部分标记:
then a Modal.cshtml partial that will contain the partial markup that you want to display in the modal:
<div>This is the partial view</div>
以及一个包含按钮的Index.cshtml视图,该按钮在单击时将部分显示为模态:
and an Index.cshtml view containing the button which will show the partial into a modal when clicked:
<script src="@Url.Content("~/Scripts/jquery-ui-1.8.11.js")" type="text/javascript"></script>
<script type="text/javascript">
(function(){
(function () {
(' .模态').click(function(){
('.modal').click(function () {
这篇关于部分视图模式弹出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文