New to Telerik UI for ASP.NET Core? Start a free 30-day trial
Update a Model Field with the RangeSlider
Environment
Product | Telerik UI for ASP.NET Core RangeSlider |
Progress Telerik UI for ASP.NET Core version | 2024.4.1112 |
Description
When submitting a form, how can I update a model field with the RangeSlider's start and end values?
Solution
The RangeSlider renders two hidden inputs behind the scene.
This behavior helps you consume and process a model property that holds an array of two numbers—start and end.
- Add a field of type
double[]
in the view model. - Bind the RangeSlider to the field.
C#
public class OrderViewModel
{
public int OrderID { get; set; }
public double[] Products { get; set; }
}