# Update a Model Field with the RangeSlider

## Environment

<table>
 <tr>
  <td>Product</td>
  <td>Telerik UI for ASP.NET MVC RangeSlider</td>
 </tr>
 <tr>
  <td>Progress Telerik UI for ASP.NET MVC version</td>
  <td>2024.4.1112</td>
 </tr>
</table>

## 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# Model
public class OrderViewModel
{
    public int OrderID { get; set; }

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

```C# Controller
public ActionResult Index()
{
    OrderViewModel model = new OrderViewModel() 
    { 
        OrderID = 1, 
        Products = new double[] { 2, 4 } 
    };

    return View(model);
}

[HttpPost]
public ActionResult Submit(OrderViewModel model)
{
    // model.Products contains the updated values

    return View("Success");
}
```

```Razor
@model MyApp.Models.OrderViewModel

@using (Html.BeginForm("Submit", "Home"))
{
    @Html.HiddenFor(model => model.OrderID)
    @(Html.Kendo().RangeSliderFor(model => model.Products))
    <br />
    <input type="submit"  value="Submit" />
} 
```

## More ASP.NET MVC Slider Resources

* [ASP.NET MVC Slider Documentation](https://www.telerik.com/aspnet-mvc/documentation/html-helpers/editors/slider/overview)

* [ASP.NET MVC Slider Demos](https://demos.telerik.com/aspnet-mvc/slider)

* [ASP.NET MVC Slider Product Page](https://www.telerik.com/aspnet-mvc/slider)

* [Telerik UI for ASP.NET MVC Video Onboarding Course (Free for trial users and license holders)](https://www.telerik.com/aspnet-mvc/documentation/getting-started/video-onboarding)

* [Telerik UI for ASP.NET MVC Forums](https://www.telerik.com/forums/aspnet-mvc)

## See Also

* [Client-Side API Reference of the Slider for ASP.NET MVC](https://docs.telerik.com/kendo-ui/api/ui/slider)

* [Server-Side API Reference of the Slider for ASP.NET MVC](https://docs.telerik.com/aspnet-mvc/api/slider)

* [Telerik UI for ASP.NET MVC Breaking Changes](https://www.telerik.com/aspnet-mvc/documentation/backwards-compatibility/2024-backwards-compatibility)

* [Telerik UI for ASP.NET MVC Knowledge Base](https://docs.telerik.com/aspnet-mvc/knowledge-base)
