开发者

MVC3 using BeginForm on IE9 Needs to submit twice before contoller gets called

开发者 https://www.devze.com 2023-04-11 09:11 出处:网络
I have a form that uses Html.BeginForm and for most cases this works as you would expect. But in some situations I display a partialview that does several ajax calls to populate itself. When the part

I have a form that uses Html.BeginForm and for most cases this works as you would expect.

But in some situations I display a partialview that does several ajax calls to populate itself. When the partial view has been displayed I need to click the submit button twice to get the form to post. On the first click I can see the form refr开发者_运维技巧esh, and then on the second click the form actually posts. This is when using IE9, using Firefox the posts work on the first click.

I would like to know if anyone has seen this behaivor before I spend a lot of time trying figure this out.


Install Fiddler, open it up, and then reproduce the issue in IE. Fiddler will capture all of the requests, so you can see exactly what was sent to the server (and back).


Had a similar issue. The reason was, we had a in view and in addition we were doing $('#form').submit() as well. But the button didn't have "type" attribute. After setting button type=button. It was good.

0

精彩评论

暂无评论...
验证码 换一张
取 消