我创建了一个名为 post 的部分控制器,它工作正常。现在我想通过模式弹出从主页索引调用它。这是我的代码层次结构(如果重要的话)
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
我哪里错了?而且,当用户从发布索引视图保存数据时,如何关闭此弹出窗口。