Slider Databinding

Hi,

How can I bind one of the fields in the model to the slider control. I used the following html just to find out upon posting the model field is not reflecting the real value and it remains null.

<ejs-slider id="default" min="0" max="10" value="@Model.Rating" step="0.5">


1 Reply

BM Balaji M Syncfusion Team August 9, 2018 12:55 PM UTC

Hi Panora, 

Thanks for contacting Syncfusion support. 

We have implemented a sample as per the shared code snippet and in that sample we bound the slider value from Model. Refer to the below code snippet. 

[Controllers/HomeControllers.cs] 

public IActionResult Index(sliderapplication.Models.SliderModel model) 
        { 
            model.value = "20"; 
            return View(model); 
        } 

[Model/SliderViewModel.cs] 

public class SliderModel 
    { 
        public string value { get; set; } 
    } 

For your convenience we have prepared a sample and attached below. Refer to the below sample link. 


Please let us know if your requirement is met and let us know if you need further assistance on this. 
Regards, 
M. Balaji 


Loader.
Up arrow icon