I am trying to call a c# method using ajax as below.
<a href="#divrecentQ" id="linkdivrecentQ" onclick="lnkClick();" aria-controls="divrecentQ" role="tab" data-toggle="tab">Click here</a>
Here is the method in JS
function lnkClick() {
alert("called");
$.ajax({
type: "POST",
url: '/amain.aspx/LoadImages',
data: {},
success: function () {
alert(1);
},
dataType: 'html'
});
alert("cal");
}
Server side:
public static void LoadImages()
{
log.Debug("LoadImages is called");
}
Server side method is not getting called.
Can someone please help?
Thanks