I stared at your code sample in disbelieve for a while and could not get the idea. I still cannot understand your thinking, even when I realized that you have no idea how Web works. Well, the error message must be about your symbol
GetTerritoriesInRegion
, which apparently does not exist. Perhaps you think that some C# code can mysteriously become a JavaScript method, but how? Only if you generate some HTML + JavaScript code with your C# code and provide it in your Web response, which you could simply put in your aspx file. Do you even understand that JavaScript works on the client part, and C# on the server?
And the attribute
[WebMethod]
is totally unrelated to this issue. Is can be used to indicate that you want to expose some method by your XML Web service. Please see:
http://msdn.microsoft.com/en-us/library/byxd99hx%28v=vs.90%29.aspx[
^].
So, what can I advise? Don't try to "solve" your problem; this is a waste of time and makes no sense. Learn how Web and HTTP work, from the very, very beginning, than get back to ASP.NET.
—SA