I’m using jQuery .Ajax to call a method from my codebehind which must be a public static method. Because of this, I can’t access any of my pages controls unless they are declared also as public static and I don’t want any of my variables or anything declared that way. If I return a List in a WebMethod, what can I do in the catch to have an error bubble back up to the client side page? The only way I can see being able to do this the way I want is if the WebMethod returns a string instead of a List.
Share
Why not just throw an exception? Here is a good article on how to catch and parse WebMethod exceptions using jQuery.