New to Telerik UI for ASP.NET CoreStart a free 30-day trial

Update a Model Field with the RangeSlider

Environment

ProductTelerik UI for ASP.NET Core RangeSlider
Progress Telerik UI for ASP.NET Core version2024.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.

  1. Add a field of type double[] in the view model.
  2. Bind the RangeSlider to the field.
C#
public class OrderViewModel
{
    public int OrderID { get; set; }

    public double[] Products { get; set; }
}

More ASP.NET Core Slider Resources

See Also