Click here to Skip to main content
15,901,035 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
My task is click Save button Actions should be done in background process...it should not take any time in same page until the execution is over....Which method we can use it???

[edit]Spurious Big and Bold removed, subject shortened - OriginalGriff[/edit]
Posted
Updated 24-Jul-13 22:39pm
v2
Comments
OriginalGriff 25-Jul-13 4:42am    
I have removed your big and bold - we all have our monitors set so we can read them: we don't need you to get "all shouty" on us when we look at your question. Save emphasis fro those parts of a sentence that need it, it's a lot more effective.
I also reduced you subject line - you don't need the whole question there and repeated in the body. The subject should be a brief overview to let us know if it is a subject we can help with - the details of your problem should be in the message body.
Thanks7872 25-Jul-13 4:48am    
Do you see any variables going here and there,strings are being converted,data is being processed,0s and 1s,did you see anything on screen?

1 solution

Make it an ajax call.
JavaScript
$("#button").click(function () { 
     $.ajax({
         url: '/Home/Save', <---url
         data: {Name:"test"},
         success: function (data) {
                    ....                   
           }
     });
});
 
Share this answer
 
Comments
santhoshkumar.dsk 25-Jul-13 5:37am    
If we use ajax means it waits for execution. i dont want to wait until the execution finish.after click button process should be done in background and i will give logout means..execution should be done background ..
Louie Gomez 25-Jul-13 5:52am    
Ajax calls are asynchronous by default so once you call an ajax it doesn't make the browser wait, it continues to process until it's finish in which case you'll have a callback method to handle it. Let me know if I understand your problem correctly.
santhoshkumar.dsk 25-Jul-13 6:27am    
I had used ajax asynchronous but when i click logout means it does not processing .
I want to run a excel sheet insertion in background for 10000 records.ater clicking save button i should logout the screen i should not wait for insertion of all records.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900