<div class="btn btn-primary" id="btnSearch">Search</div>
<script src="<% = Page.ResolveUrl("~/Scripts/jquery-latest.js") %>"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#btnSearch').click(function() {
$.ajax({
method: 'POST',
url: 'MenuBackoffice.aspx/onSearch',
contentType: 'application/json; charset=utf-8',
dataType: 'json',
data: { },
success: function (msg) {
}
});
});
});
</script>
[WebMethod]
public static void onSearch()
{
}
Simple代碼沒有達到我的WebMethod,我不知道什麼是錯的,有人可以添加一些光?
編輯:在調試,我發現了以下錯誤: ailed加載資源:服務器500(內部服務器錯誤)的狀態
是jquery的loading? –
也有你試圖把你的網址前面的一個? .. like:url:'/MenuBackoffice.aspx/onSearch', –
這是一個服務器端錯誤(線索在「Internal * Server * Error」中):)啓用完整的錯誤顯示在您的服務器上以查看實際bug –