Click here to Skip to main content
16,020,669 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
<script type="text/javascript">
function callcspage()
{
$.ajax({
type: "POST",
contentType: "text/xml",
url: "test.aspx/testmethod",
datatype: "xml",
data: "<form><t>rrt</form>",


//contentType: "application/json",
//url: "test.aspx/testmethod",
//datatype: "xml",
//data: "",
success: function (data) {
alert("success");
},
error: function (result) {
alert("error");
}
});
}

callcspage();
</script>

webmethod in .cs page

[System.Web.Services.WebMethod]
public static void testmethod()
{
int i = 2;
}

now i want to call this webmethod which is in .cs page but its not calling but it gives success message even tough it doesnt break at the breakpoint in .cs page
Posted
Comments
Krunal Rohit 8-Nov-15 9:12am    
What data are you posting ?

-KR
Member 7895843 8-Nov-15 9:14am    
<form>rrt</form>
this is just static data for test .... but in practical i will be sending svg tag which is xml fomrat data .....svg is hmtl 5 tag...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900