1) First ,you have not mentioned method name in Ajax post method
2) You have not create webmethod
3) Yu have not returned any kind of data from webmethod than how can you ger any results in Success function??
Here i have created small example of ajax method for you.. :).First of all set jQuery link to use ajax method
<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
function GetData() {
var MyName = "Nirav Prabtani";
$.ajax({
type: "POST",
url: "PageName.aspx/MethodName",
contentType: "application/json;charset=utf-8",
data: "{'Name':'"+MyName+"'}"
dataType: "json",
success: function (data) {
alert(data.d);
},
error: function (result) {
alert("error");
}
});
}
c#
[WebMethod]
public static string MethodName(string Name)
{
return Name;
}