How to access controls in web method in ASP.Net

on Apr 08, 2016 01:52 AM

How to access Controls in web methods ...I m trying to access controls(label,dropdownlist,textbox..etc) on inside web method ..i m getting error (Object reference not set to an instance of an object)...plz help....if its any posible to access controls in webmethods....? How to Find control on my page...?

Download FREE API for Word, Excel and PDF in ASP.Net: Download
on Apr 08, 2016 04:39 AM


Well, that's not the correct approach. At the web service method level you cannot see anything about the page structure. In this method you can only load your list of items and return it. Where this list is binded to is none of GetListItems' business.

You can manage the display of the Items by implementing a callback function (see for example) or by using the UpdatePanel approach.