//index.aspx [HTML] <head> <script type="text/javascript"> function invoiceLog( d1 , d2 ) { $.ajax({ type: 'POST', contentType: 'application/json;', data: '{data1:"' + d1 + '", data2:"' + d2 + '"}', //傳值 dataType: 'json', async: false, url: 'url.aspx/ FunctionName ', //url.aspx:傳值到指定的網址 ; FunctionName:呼叫.cs的function success: function (result) { alert(result.d.RtnMsg); // } }); } </script> </head> //url.aspx.cs [.CS] [ WebMethod ] public static object FunctionName (string data1 , string data2 ) { //要執行的程式 //回傳 return new { //輸入要回傳的id和值 RtnCode = "101", RtnMsg = &quo