2011-08-22 75 views
0

如何通過.net發送郵件,帶有ajax-jquery請求?.Net Ajax jQuery表單

我是新來的.NET所以真的不知道該怎麼做,但我不認爲這是一個長期的代碼,誰能幫助我?

HTML

<form action="" method="get" id="mapKontaktForm" onsubmit="return false;"> 
     <input type="text" value="Indtask dit navn" /> 
     <input type="text" value="Indtask dit tlf. nr." /> 
     <input type="text" value="Indtask dit post nr." /> 
     <input type="submit" value="Send" id="mapFormSubmit" onclick="return false;" /> 
</form> 

jQuery的AJAX

$('#mapFormSubmit').click(
       function(){ 
var name = $('#mapKontaktForm input:nth-child(1)').val(); 
var phone = $('#mapKontaktForm input:nth-child(2)').val(); 
var post = $('#mapKontaktForm input:nth-child(3)').val(); 

var dataString = 'name='+ name + '&phone=' + phone + '&post=' + post; 

$.ajax({ 
    type: "GET", 
    url: "/files/billeder/../Templates/Designs/Ideal2011/js/contactForm.aspx", 
    data: dataString, 
    success: function() { 
      $('.acceptBox').fadeIn(1000); 
     }, 
     error: function(){ 
       $('.errorBox').fadeIn(1000); 
      } 
    }); 
    return false; 
} 

應在ASPX或ashx的文件有什麼用電子郵件發送這三個值?

回答