我有以下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"
})
但是当我点击删除链接时;确认消息“确认=”您确定要执行删除。“”将在调用操作方法之前显示两次,之后显示一次。 那可能是什么问题? 目前我在视图中使用以下脚本
<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>
答案 0 :(得分:6)
可能是因为您多次引用相同的库。
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!
它们是相同的lib,尽管只有minified。尝试清理lib引用,这将解决您的消息显示问题两次。
答案 1 :(得分:0)
两个错误可能导致此类问题: