Click here to Skip to main content
15,891,597 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all ,

Does asp.net web method triggers a postback ?

Thanks in advance.
Posted
Comments
AspDotNetDev 26-Sep-11 17:13pm    
Do you mean Page Methods (which are created using the WebMethod attribute)? Also, it depends on how you are using the methods (e.g., if you are calling them from JavaScript).

It depends on the way you are calling, if you calling it from client side using JQuery or javascript, then no post back, but if you are invoking them from server side then yes. So its not mandatory that they will have post backs
 
Share this answer
 
I agree with Anuja Pawar Indore. It depends on the code you are executing, like if you are executing server side code, it will trigger and if you are executing client side code then it might be not. so it is not mandatory. It depends upon your requirement and implementation accordingly.

Good luck.
 
Share this answer
 
Hello friend..

post back of method is depend on the way you call it..

1) if you call that method from any button click event or any other server control event then it will be goes for post back

2) Or if you call that web method using javascript or jquery or Ajax call then it will not post back

so method post back will depends on your type which you use to call it..
 
Share this answer
 
hi :)

refer that msdn link help you to overcome this problem....

http://msdn.microsoft.com/en-us/magazine/cc163413.aspx[^]
 
Share this answer
 
Ya methods like changing the selected index or button click triggers a post back
you can use (IsPostack) method for which events are triggered out and which are not
 
Share this answer
 
Comments
AspDotNetDev 26-Sep-11 17:12pm    
Your answer has nothing to do with web methods.

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