The Simple code below
<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()
{
}
Is not reaching my WebMethod, i don't know what is wrong, can someone add some light?
EDIT: In the debug i'm getting the following error: ailed to load resource: the server responded with a status of 500 (Internal Server Error)