Search code examples
asp.netpagemethods

PageMethod and interaction with UI controls in page asp.net 4.0


we know PageMethod is static. so i tried to access a label for changing text but could not do just due to PageMethod static in nature. so i wish to show data through gridivew and need the common operation like sorting paging inline update add/delete then how can i accomplish it by pagemethod. i want to use pagemethod because it is faster. so guide me please in detail.tahnks.


Solution

  • What you want is not easily accomplished using PageMethods due to the fact that they are static and have no access to the page's control collection. I have used Custom Callback Control with great success for asynchronously paging and sorting GridView. Please have a look at this article: CallBack Custom Control