This example explains how to populate a cascading ASPxComboBox by using WebMethods. On the client side, the master ASPxComboBox is subscribed to the SelectedIndexChanged event. When the event is raised, it sends a request to the server by WebMethod. If the request is successful, a child ASPxComboBox is populated with the response object.
On the client side, WebMethod is called by the following code:
[JScript]PageMethods.GetData(id, OnSuccess);
On the server side, ScriptManager is used with EnablePageMethods set to "True":
[ASPx]<asp:ScriptManagerID="ScriptManager1"runat="server"EnablePageMethods="true"></asp:ScriptManager>
The C# method is marked by WebMethodAttribute:
[C#]usingSystem.Web.Services;[WebMethod]publicstaticList<Product>GetData(stringcategoryID){//method code}