FAQ in ASP.NET AJAX Networking and Web Serviceshttp://forums.asp.net/t/1198029.aspx/1?FAQ+in+ASP+NET+AJAX+Networking+and+Web+ServicesWed, 26 Dec 2007 03:23:32 -050011980292076926http://forums.asp.net/p/1198029/2076926.aspx/1?FAQ+in+ASP+NET+AJAX+Networking+and+Web+ServicesFAQ in ASP.NET AJAX Networking and Web Services <p><a class="mceItemAnchor" title="top" name="top"></a><a href="http://forums.asp.net/t/1198029.aspx#faq01">1. Why cant I access page controls in PageMethod?</a><br> </p> <hr> <p><b>1. Why cant I access page controls in PageMethod?</b><a class="mceItemAnchor" title="faq01" name="faq01"></a><br> PageMethod is invoked via Reflection. <br> When the server receives a request for the PageMethod, it uses ProcessRequest(HttpContext context) method in System.Web.Script.Services.RestHandler class to serve it. Reflection is used internally to invoke PageMethod which is public and static.<br> Its not accessed via an instance of the page. Also, this request doesnt go through the regular lifecycle of a normal request for .aspx page. Therefore, controls on the page cant be accessed inside the PageMethod.<br> </p> 2007-12-26T03:23:32-05:00