This is a migrated thread and some comments may be shown as answers.

Bug in unobtrosive ajax file bundling

0 Answers 71 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
mahmoud
Top achievements
Rank 1
mahmoud asked on 27 Feb 2012, 03:19 PM
Dear Teleriks , 

I had bundled my scripts like this : 

<script src="@Url.Content("~/Scripts/jquery-1.7.1.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/MicrosoftAjax.min.js")" type="text/javascript"></script>
@(
 Html.Telerik()
    .ScriptRegistrar()
    .jQuery(false)
    .jQueryValidation(false)
    .DefaultGroup(o => o.Enabled(false))
    .Scripts(scripts =>
    {
        scripts.AddGroup("HeaderScript", group =>
        {
            group
                .Combined(true)
                .Compress(true)                
                .Add("~/Scripts/jquery.validate.min.js")
                .Add("~/Scripts/jquery.validate.unobtrusive.min.js")
                .Add("~/Scripts/jquery.unobtrusive-ajax.min.js")
                .Add("~/Scripts/MicrosoftMvcAjax.js")
                .Add("~/Scripts/MicrosoftMvcValidation.js");
        });
    }))

But I had a strange problem : multiple same ajax call in one click! (I mentioned the details here : http://stackoverflow.com/questions/8486254/4-time-same-ajax-request-by-one-ajax-call-why )
After long time of searching for the source of problem , accidentally I found the problem solved after pull out the
jquery.unobtrusive-ajax.min.js from telerik bundling component like this:

<script src="@Url.Content("~/Scripts/jquery-1.7.1.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/MicrosoftAjax.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js")" type="text/javascript"></script>

@(
 Html.Telerik()     .ScriptRegistrar()     .jQuery(false)     .jQueryValidation(false)     .DefaultGroup(o => o.Enabled(false))     .Scripts(scripts =>     {         scripts.AddGroup("HeaderScript", group =>         {             group                 .Combined(true)                 .Compress(true)                                 .Add("~/Scripts/jquery.validate.min.js")                 .Add("~/Scripts/jquery.validate.unobtrusive.min.js")                 .Add("~/Scripts/MicrosoftMvcAjax.js")                 .Add("~/Scripts/MicrosoftMvcValidation.js");         });     }))
  

And after that everthing worked fine!
Tags
General Discussions
Asked by
mahmoud
Top achievements
Rank 1
Share this question
or