Search code examples
javascriptweb-servicescallcode-behindwebmethod

Why we use web methods of web services, instead of web form funcions


There's a period of time that I changed my web programming method. I develop my functions as web methods in some Web Services, then I call them in my website's UI using javascript. My question is why do we use web services? I think it's better to write these functions in the code behind of original page and call them with javascript. Isn't it better?


Solution

  • Webservices can be called from any platform, but the code in the behind of web forms can not.