Monday, 2 September 2013

Adding JQuery validation script to header causes the action methods to fire twice

Adding JQuery validation script to header causes the action methods to
fire twice

On any MVC sample application , adding
@Scripts.Render("~/bundles/jqueryVal") to the header causes the action
method on any link to execute twice.
I have put down the sample header for reference. Can some explain why this
might happen ?
<head>
<meta charset="utf-8" />
<title>Cool Blogger</title>
<meta name="viewport" content="width=device-width" />
<script type="text/javascript" src="~/Scripts/jquery-1.8.2.min.js"
></script>
<script type="text/javascript" src="~/Scripts/jquery-ui-1.8.24.js"
></script>
<script type="text/javascript"
src="~/Scripts/jquery.unobtrusive-ajax.min.js"></script>
@Styles.Render("~/Content/css")
@Scripts.Render("~/bundles/modernizr")
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/jqueryVal")
</head>

No comments:

Post a Comment