I have web site project which contains app_code folder that contains ConnectCrm.cs. Also in this project i have VoC.cshtml file. I want to call method from ConnectCrm.cs file using ajax in VoC.cshtml file like this :
<script type="text/javascript">
$(document).ready(function () {
$("#serialno").change(function () {
$.ajax({
type: "POST",
url: "/App_Code/ConnectCrm.cs/CheckSerialNo",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function () {
alert($("#serialno").text());
},
error: function () {
alert('Hello');
}
});
});
});
</script>
But i couldn't. It gives me error continuously. i have no idea actually, this is possible with ajax or not.