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

MVC Wrappers cause double AJAX postback in debug mode using Ajax.Beginform()

2 Answers 183 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 2
Andrew asked on 17 Oct 2012, 11:32 AM
For anybody who finds this problem, the fix is to add the following line to the bundleconfig.cs file:

bundles.IgnoreList.Ignore("*.unobtrusive-ajax.min.js", OptimizationMode.WhenDisabled);


This will prevent the unobtrusive ajax script from loading twice (i.e. the minified and non-minified) in debug mode, which is what causes the double postback.

Alternatively, just remove the non minified script from the project (this obviously has implications for debugging, if you're inclined to debug the scripts included in the project template).

Telerik - this ought to be included in your how-to guide.

2 Answers, 1 is accepted

Sort by
0
Brian
Top achievements
Rank 1
answered on 21 Oct 2014, 07:10 PM
Holy cow, been beating my head up against a wall for a couple hours over this.  Finally found this post.  Thanks!!
0
Sebastian
Telerik team
answered on 23 Oct 2014, 01:13 PM
Hello guys,

Thank you for the feedback. I notified our documentation writers and this info will be added to the MVC troubleshooting help topic with the next help update.

Best regards,
Sebastian
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
General Discussions
Asked by
Andrew
Top achievements
Rank 2
Answers by
Brian
Top achievements
Rank 1
Sebastian
Telerik team
Share this question
or