Search code examples
asp.net-mvc-3unobtrusive-ajax

4 time same ajax request by one ajax call, why?


I have the following code in MVC 3.0 with unobtrusive JavaScript enabled.

 using (Ajax.BeginForm("search", new { puremode = 1 }, new AjaxOptions(){ UpdateTargetId="searchResult"} ))
{
<fieldset>
    <legend>aaa</legend>
    @Html.Partial("_SearchCriteria", Model)
    <p>
        <button class="t-button" type="submit">
            <span class="icon16 xmag-png"></span>Search...</button><br />
    </p>
</fieldset>
}

clicking on search button makes 4 Ajax requests simultaneously which causes to call "success" method 4 times too!

NOTE!!! If I disable the unobtrusive JavaScript the problem disappears! please check the attached image.

Firebug result


Solution

  • It seems the source of problem comes from Telerik bundling strategy. I described the problem here : Telerik forum hope to be helfull for others