gpt4 book ai didi

jquery - Ajax.ActionLink 确认消息显示两次

转载 作者:行者123 更新时间:2023-12-01 02:47:04 25 4
gpt4 key购买 nike

我有以下ajax.actionlink

  @Ajax.ActionLink("Delete", "Delete", "order",

new { id = order.OrderID },
new AjaxOptions
{
Confirm = "are you sure to perform the deletion.",
HttpMethod = "Post",
UpdateTargetId = order.OrderID.ToString(),
LoadingElementId = "Progress"
})

但是当我点击删除链接时;确认消息“Confirm =“您确定要执行删除吗?”将显示两次,一次在调用操作方法之前,一次在调用操作方法之后。那么可能是什么问题呢?目前我在 View 中使用以下脚本

<script src="@Url.Content("~/Scripts/jquery-ui-1.8.14.js") type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery-ui-1.8.14.min.js") type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jQuery.tmpl.js") type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.js") type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js") type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate-vsdoc.js") type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.js") type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js") type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js") type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.js") type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery-1.6.2.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js")" type="text/javascript"></script>

<script src="@Url.Content("~/Scripts/jQuery.tmpl.min.js") type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery-1.6.2-vsdoc.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery-1.6.2.js") type="text/javascript"></script>

已编辑:- 我删除了所有重复的脚本,最终只剩下这些脚本,但问题仍然存在:-我最终只得到了这些脚本,但问题仍然存在

<script src="@Url.Content("~/Scripts/jquery-1.6.2.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery-ui-1.8.14.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate-vsdoc.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jQuery.tmpl.min.js")" type="text/javascript"></script>

最佳答案

可能是因为您多次引用相同的库。

jQuery.tmpl.js 
jQuery.tmpl.min.js

jquery-1.6.2.min.js
jquery-1.6.2.js

jquery.unobtrusive-ajax.js
jquery.unobtrusive-ajax.min.js
jquery.unobtrusive-ajax.min.js //Three times!

它们是同一个库,尽管其中一个只是 minified 。尝试清理您的库引用,这将解决消息显示两次的问题。

关于jquery - Ajax.ActionLink 确认消息显示两次,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9049243/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com