Reputation: 68952
I am using Javascript-JQuery to submit 2 aspx pages,
$('#MyForm1').submit();
$('#MyForm2').submit();
for some reason i want form1 to don't start loading or submitting until form1 finish loading.
I want all of this to be server side.
Can a page wait another page in asp.net?
Upvotes: 0
Views: 795
Reputation: 268364
I want that server side as i said in my Question
– Amr ElGarhy
jQuery is not ran or accessible from the server. Your server cannot control your client-side scripts, not directly at least. I am not sure what you mean by "wanting this server-side." What you can do is send off a request to your server with the first submission (of form1), and when the response is being constructed on the server, add rules to tell the client-side script what to do with the second form.
Beyond that, you aren't being entirely clear.
You'll have to send the data from form1 asynchronously, and then within the callback (assuming success) submit form2.
Read More: jQuery AJAX
Upvotes: 3
Reputation: 421
Call back methods are your friend here:
$('#MyForm1').submit(function() {
$('#MyForm2').submit();
});
That will make the second submit happen after the first.
Upvotes: 2