Search code examples
jqueryasp.netajaxpagemethods

Unable to access ServerSide Controls from Page Method


Any way to access DropDownList control from Page Method? I am calling PageMethod with Jquery.ajax(), inside the Page Method doing database queries and trying to fill the dropdownlist from database. But I am not able to access to dropdownlist as Page Methods are static.


Solution

  • In web service method you cannot see anything about the page structure.But if you want to fill your dropdownlist value from jquery you can use other techniques.Check out following link for complete example

    Fill dropdown by using Asp.net PageMethods and calling C# functions / methods from JavaScript