Reputation: 8291
I have been using PageMethods in develping asp.net c# applications for a long time.
I realized that sometimes I have to call the same method from different pages, and copy and paste the same method to those pages.
This definitely creates redundancy problems, I know.
Would it be fine to create a separate *aspx pages just for hosting the related PageMethods.
What is the common practice in this?
Upvotes: 0
Views: 49
Reputation: 23571
I would recommend that you switch to AJAX-enabled WCF Service. It requires a bit more configuration but once you get it working for one service you can copy/paste it for another. At this point you add the proxy JS to your page and use it pretty much the same way you use PageMethods. Of course there are multiple other ways to do AJAX but I AJAX-enabled WCF services are almost drop-in replacement for Page Methods... almost.
Upvotes: 1