0

I have a MVC project with razor syntax in partial views. Each view has some jquery functions which load some data in forms. Because of asynchronous loading of functions, it may take some seconds to load all functions in the form. If a user click submit button before loading all jquery functions, data lost will occur.

what is the best solution,please?

My view is look like this:

<input type="submit" id="save" />
...
<script type="JavaScript/text">
...
$.getJSON(actionUrl1, function (data) {...});
...
$.getJSON(actionUrl2, function (data) {...});
...
</script>
4

1 に答える 1

1

頭に浮かぶ 1 つの可能性は、AJAX 要求の実行中に送信ボタンをブロックし、成功ハンドラーでブロックを解除することです。jQuery blockUI plugin役立つと思われる も参照してください。

于 2013-02-25T09:06:31.927 に答える