Why code behind method should be static if calling from ajax and web service (asmx) method not static? -


i have come across situation have call asp page code-behind method using ajax client side. found code behind method should static in order call client side using ajax asmx web service method normal class method.

why code-behind method should static , why asmx web service method not? there object theory running behind scene or other theory?

please me!

you can find answer on question right here

so, why page method calls have static?

if you’re implementing page methods, you’re aware of excellent performance. performant compared updatepanel’s partial postbacks.

they efficient largely because not require viewstate posted , not create instance of page, while partial postbacks both of these things. know, page method couldn’t create instance of page if desired, since viewstate isn’t provided in request.

this why must marked static.

they cannot interact instance properties , methods of page class, because page method call creates no instance of page or of controls. page methods equivalent shorthand standalone web services. in fact, scriptmanager calls them regular web service.


Comments

Popular posts from this blog

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -