Click here to Skip to main content
15,888,020 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have Jquery Msgbox and i want to call it while sending mail function is processing.

i call that but because of js it call after execution of back-end coding and it is not used....
Posted
Comments
ZurdoDev 5-Apr-13 7:23am    
So, what's the question? Use jquery's ajax() and call a webservice to send the email.
Sergey Alexandrovich Kryukov 5-Apr-13 11:46am    
You are mixing up client and server parts, it looks like. First, try to learn how HTTP and ASP.NET work...
No, sorry, I think you do understand that, basically, but you need to pose a problem correctly. If your server-side operation is not complete, you cannot invoke any JavaScript, as there is no a page on a client side yet. You need to focus on the effect you want to get. Do you want to show the progress in sending mail somehow?
—SA

1 solution

Hi
you can use jquery ajax to send email like for example

when you click on button to send email ,you have to call jquery ajax function
$("#btnSendEmai;").click(function(){

// Show message box
    $('#dvMessage').show();

// Call SendEmail method
    $.ajax({
        url:'Default.aspx/SendEmail'
        type:'Get'
        datatype:'json'
        async:false,
        cache:false,
        success:function(data){
         
        // Hide message box on success
          $('#dvMessage').hide();
        },
        error:function(msg){
        }
    });
});
 
Share this answer
 
v2

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