1 <script type="text/javascript">
2 $(function () {
3
4 // Initialize progress dialog ...
5 $("#ProgressDialog").dialog({
6 autoOpen: false,
7 draggable: false,
8 modal: true,
9 resizable: false,
10 title: "Loading",
11 closeOnEscape: false,
12 open: function () { $(".ui-dialog-titlebar-close").hide(); } // Hide close button
13 });
14
15 // Handle form submit ...
16 $("form").live("submit", function (event) {
17 event.preventDefault();
18 var form = $(this);
19 $("#ProgressDialog").dialog("open");
20 $.ajax({
21 url: form.attr('action'),
22 type: "POST",
23 data: form.serialize(),
24 success: function (data) {
25 $("#FormContainer").html(data);
26 $.validator.unobtrusive.parse("form");
27 },
28 error: function (jqXhr, textStatus, errorThrown) {
29 alert("Error '" + jqXhr.status + "' (textStatus: '" + textStatus + "', errorThrown: '" + errorThrown + "')");
30 },
31 complete: function () {
32 $("#ProgressDialog").dialog("close");
33 }
34 });
35 });
36 });
37 </script>

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-31
  • 2021-10-22
  • 2021-10-03
  • 2022-02-08
  • 2021-07-18
猜你喜欢
  • 2021-12-02
  • 2021-09-26
  • 2022-12-23
  • 2022-12-23
  • 2022-03-04
  • 2021-10-27
  • 2021-09-03
相关资源
相似解决方案