Quantcast
Channel: DevExpress Support Center (Examples)
Viewing all articles
Browse latest Browse all 7205

How to populate a cascading ASPxComboBox by using WebMethods

$
0
0

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}



Viewing all articles
Browse latest Browse all 7205

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>