我創建了一個名爲post的部分控制器,它工作正常。現在我想通過模態彈出來從Home索引中調用它。這裏是我的代碼 層次(如果該事項)Modal在ASP.NET MVC 4中彈出不起作用
View
Account
Home
- Index
Post
- Index
首頁/索引視圖
<script src="~/Scripts/jquery-1.7.1.js"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.js")" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
$('.popupLink').click(function() {
$('<div id="popupfooterdiv"/>').appendTo('body').dialog({
close: function (event, ui) {
dialog.remove();
},
modal: false,
draggable: false,
width: 500,
height: 400,
resizable: false,
}).load(this.href, {});
return false;
});
});
</script>
@Html.ActionLink("Open Pop Up", "Home", "actionName", new {@class="popupLink"})
首頁控制器
[HttpPost]
public ActionResult actionName()
{
return PartialView("Post");
}
當我點擊它,它被重定向到我出現以下錯誤的錯誤頁面
Server Error in '/' Application.
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /Home/Home
也是我的網址更改
http://localhost:2654/Home/Home?Length=10
我哪裏錯了? 還有, 當用戶從Post index視圖保存數據時,如何關閉此彈出窗口。