我想打電話從aspx頁面C#函數的調用我試圖像下面如何使ASPX頁面上的非靜態C#功能
function DeleteKartItems(callback) {
$.ajax({
type: "POST",
url: 'About.aspx/updatingdatabase',// my function name in c#
data: '{"username":"' + col1 + '","password":"' + col2 + '","age":"' + col3 + '","city":"' + col4 + '","id":"' + idlast + '"}',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data) {
var x = data.d;// i am trying to store the return data into a local variable
},
error: function (e) {
}
});
}
我的問題是,它的作品很好,當我寫的C#函數爲靜態,但其他明智不會 工作,我想知道是否有任何方法調用從靜態c#函數從aspx頁 在此先感謝
可能重複:http://stackoverflow.com/questions/1360253/call-non-static-method-in-server -sideaspx-cs-from-client-side-use-javascript?lq = 1(可能是其他人) – Olaf 2014-11-04 06:49:18
感謝您的快速回放。但它不會在我的程序 – 2014-11-04 07:30:31