Sunday, 15 September 2013

asp.net - How WebMethod behaves during Ajax Call? -



asp.net - How WebMethod behaves during Ajax Call? -

when calling webmethod on webpage using jquery. define static.

however static methods have 1 instance. happens when multiple web requests made.

does happen asynchronously or all requests pipelined waiting webmethod take requests?

i created sample console programme simulate scenario on static method work & found them execute in sequential order.

class programme { static int count = 10; static void main(string[] args) { new program().foobar(); console.readline(); } public void foobar() { parallel.invoke(() => work("one"), () => work("two"), () => work("three"), ()=> work("four")); } static void work(string str) { thread.sleep(3000); count++; console.writeline(str + " " + count); } }

can please set lite on concept?

they not execute sequentially. if created multiple apps in client server scenario improve illustration since console app inherently runs sequentially.

that said, static methods need aware of shared resources, data, etc. local info fine.

asp.net jquery

No comments:

Post a Comment