I attempted to invoke a C# method using jQuery but it failed. The reason is because the method cannot be found. However the method exist in the class. Did I miss something?
Your help is kindly appreciated.
Thank You
I attempted to invoke a C# method using jQuery but it failed. The reason is because the method cannot be found. However the method exist in the class. Did I miss something?
Your help is kindly appreciated.
Thank You
Maybe this will help: http://www.xdevsoftware.com/blog/post/Call-WebMethod-from-Javascript-in-ASPNET.aspx
Try using Page Methods or web services.
With Page Methods, you will not need to use jQuery.
http://www.singingeels.com/Articles/Using_Page_Methods_in_ASPNET_AJAX.aspx
Remember that your method needs to be static.
Try using Page Methods or web services.
With Page Methods, you will not need to use jQuery.
http://www.singingeels.com/Articles/Using_Page_Methods_in_ASPNET_AJAX.aspx
Remember that your method needs to be static.
You mean I should replace the code below:
public string returnJson(){
tojson = Json.ToJSON(people);
return tojson;
}
To:
public static string returnJson(){
tojson = Json.ToJSON(people);
return tojson;
}
I found the solution. You may review the attachment.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.