WebDrillDown for ASP.NET Core MVC
Select Server:
  Reset Ready
Built-in Ajax:
This sample demonstrates how you can use the built-in Ajax ability of WebDrillDown to populate the popup menus.

To use this feature, you can set the following WebDrillDown server-side property to the URL of a web service that can supply the necessary information:

WebDrillDown.DataRetrievalUrl("/DemoService/GetPopupData")

This sample uses an ASP.NET Core MVC controller that implements that following C# method for this purpose:

[HttpPost]
public JsonResult GetPopupData([FromBody]RequestData requestData)

The name of this method is specified in the URL above, and accepts a "RequestData" object containing the parameters for the request. The parameters are:
  • controlId - the control identifier of the WebDrillDown instance.
  • requestPath - the path to the data required for the popup menu.
The web service defines a helper class "PopupData" that is serialized to return the popup information in JSON format.

If the built-in Ajax encounters an error during the retrieval of information from the web service, it uses the following client-side method:

function cwddOnDataRetrievalError(controlId, statusCode, statusText)

This callback method can be implemented by you to allow reporting of the error to your users. WebDrillDown will automatically detect the presence of this method, and call it whenever it has trouble fetching data from the web service. The parameters are:
  • controlId - the control identifier of the WebDrillDown instance.
  • statusCode - the status code returned when retrieving popup information.
  • statusText - the status description returned when retrieving popup information.
Additionally, whenever WebDrillDown starts/stops retrieving data for any of the possible data retrieval modes it calls the following client-side callback methods:

function cwddOnDataRetrievalBegin(controlId)
function cwddOnDataRetrievalEnd(controlId)

These callback methods are demonstrated here by displaying the "Loading..." or "Ready" message.

In this sample the WebDrillDown is allowing you to select a datacenter server, organized by region, location and role. Clicking the "Submit" button will send the full path for your selection to the server and it will be displayed below:
No path selected.
Click the "Reset" link to clear your selection.
Control being used:
Coalesys WebDrillDown for ASP.NET Core MVC
Version 1.0 - Build 130 (Licensed)
Designed for ASP.NET Core MVC 8.0 (64-bit)
Copyright (c) 2000-2024 Coalesys, Inc.
View the code:
The code is available in the samples directory under:
/DataRetrieval
    /BuiltinAjax