Click here to Skip to main content
15,560,073 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I know that Web Methods are light weight and gives you speed since there is no post back. I found that a Web Method can be added to a .aspx webform just like in .asmx web service file. Is there any difference ? Any advantage or disadvantage of doing or not doing so?
arbaaz jalil 14-Jul-13 17:53pm    
aspx.cs and asmx.cs to be more accurate
Swinkaran 14-Jul-13 23:40pm    
doing or not-doing? Depends on the native of your application.

Goods - Much easier to implement security for the call, JSON can be used
Doesn't any life cycle(Page life-cycle is a pain)
Logic and functionality are not localized and reusable.

Bad - Posting forms to webmethods is sometimes Hectic.
arbaaz jalil 15-Jul-13 2:35am    
I meant is there any disadvantage or advantage in using Web Method in asmx.cs over web method in .aspx.cs?

1 solution

web services are not light weight, in fact they are quite the opposite because they generally receive and respond to data using XML (a bulky format). However, this makes them very easy to use with other programming languages.
Web services excel at making an application compatible with other programming platforms or for serving up AJAX requests to a web page. There are many other uses, but typically using WCF or HttpHandlers are better options in those cases.
Share this answer
arbaaz jalil 15-Jul-13 5:57am    
The question is not "Difference between web service and WCF" the question is "Is there any difference in method used in a asmx.cs and web method used in a aspx.cs?"

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900