Simple |
The Select control uses the HTML Select element to create a data-driven selection control that can be populated with all the supported data sources. You can use the OptionSelected event to interact with the selected value. |
Loading...
Razor code
SelectModel customerSelect = new SelectModel(DataSourceType.SQLite, "northwind", "Customers")
{
Caption = "Customer",
EmptyOption = "Please select a customer",
Columns = new List()
{
new SelectColumn("CustomerID"),
new SelectColumn("CompanyName")
}
};
customerSelect.ClientEvents[SelectClientEvent.OptionSelected] = "showSelectedCustomer";
@(await new DbNetSuiteCore.SelectControl(HttpContext).Render(customerSelect))
<div id="selectedCustomer"></div>