hi ,
i am using master page and want to execute webmethod of master page . but getting 404 not found error or 500 please check my code.
<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
function calldata() {
alert('webmethod');
$.ajax({
type: "POST",
url: '<%=ResolveUrl("~/MainMdi.master/HelloWorld")%>' ,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (msg) {
alert(msg.d);
},
error: function (xhr, ajaxOptions, thrownError) {
alert(xhr.status);
alert(thrownError);
}
});
return false;
}
calldata();
});
</script>
[WebMethod]
[System.Web.Script.Services.ScriptMethod(UseHttpGet = true)]
public static string HelloWorld()
{
return "Hello World";
}