Files to look at:
- Default.aspx (VB: Default.aspx)
- Default.aspx.cs (VB: Default.aspx.vb)
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:
PageMethods.GetData(id, OnSuccess);
On the server side, ScriptManager is used with EnablePageMethods set to "True":
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true"></asp:ScriptManager>
The C# method is marked by WebMethodAttribute:
using System.Web.Services;
[WebMethod]
public static List<Product> GetData(string categoryID) {
//method code
}