Html.RenderPartial and Ajax.BeginForm -> Submit is called twice

て烟熏妆下的殇ゞ 提交于 2019-11-30 01:58:46

Don't include scripts inside your partial views! They should go the your "main" views or your _layout.cshtml.

Your problem is that you have included the jquery.unobtrusive-ajax.min.js twice in your page. Once in your Create partial and once somewhere else. Because if you include that script multiple times it will subscribe on the submit event multiple times so you will get multiple submit with a single click.

So make sure that you have include that script only once in a page. So move the jquery.unobtrusive-ajax.min.js reference into your index view.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!