我有以下删除对象的Ajax.actionlink: -
@Ajax.ActionLink("Delete", "Delete", "Answer",
new { id = answer.AnswersID },
new AjaxOptions
{
Confirm = "Are You sure You want to delete this Answer ?",
HttpMethod = "Post",
UpdateTargetId = @answer.AnswersID.ToString(),
OnSuccess = "removePartial2",
})
以及将被称为Onsuccess的以下removePartial2 java脚本: -
<script type="text/javascript">
function removePartial2() {
alert('Deletion was successful');
$(this).remove();
}
</script>
我想测试如果我的应用程序没有运行,ajax动作链接将如何工作,所以我停止从可视化Web开发人员调试应用程序,但我注意到即使我停止调试应用程序,ajax链接仍将从数据库中成功删除对象,但alert('Deletion was successful')
将不会显示,那么可能导致这种不正常行为的原因是什么?
答案 0 :(得分:1)
如果您在Visual Studio中进行调试,当您停止调试时,您的应用程序将继续运行,直到您停止ASP.NET Develpoment Server,因此您的数据库代码仍将运行,直到您退出VS或退出服务器(在托盘中,右键单击 - &gt;停止)