Why WebMethods cannot be static methods

by rbellantoni 3/31/2010 7:15:00 AM

I have not found a very clear explanation as to why static methods cannot be used in conjuncture with web service calls and page methods.

Well the answer is pretty simple. In order to work with javascript ASP.NET creates a proxy class from the class the web service points to. So when you make a call from javascript to the web service your calling the generated proxy class. However, static methods are inherently separate from the class and can be called without making an object reference to the class. Therefore it cannot be generated with the javascript proxy class and as such cannot be referenced.

 

Tags:

Comments

4/1/2010 5:14:05 PM

games

Wii users will be able to download a selection of new additions for their own Avatars with codes.

games United States

Powered by BlogEngine.NET 1.5.0.7
Theme by Mads Kristensen

About the author

Name of author Author name
Something about me and what I do.

E-mail me Send mail

Calendar

<<  November 2017  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910

View posts in large calendar

Recent comments

Tags

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2017

Sign in