- Min value
- Single selection
- Show or hide reset button
Contact Support
Selection in ASP.NET MVC Rating Control
24 Jan 20232 minutes to read
The ASP.NET MVC Rating control allows users to rate something using a visual scale, and the selection state can be changed by the user clicking or tapping on the stars in the rating scale or through code. The Rating control has a minimum value and a reset button, and provides customization options for the selected rating value and selection behavior.
@using Syncfusion.EJ2.Inputs
@Html.EJS().Rating("rating").Value(3).Render()
public ActionResult Selection()
{
return View();
}
Min value
You can use the Min property of the ASP.NET MVC Rating control to set the minimum possible rating value the user can select. If you set the Min
property to 2, then you will not be able to select a rating lower than 2.
@using Syncfusion.EJ2.Inputs
@Html.EJS().Rating("rating").Min(2).Render()
public ActionResult Min()
{
return View();
}
Single selection
You can use the EnableSingleSelection property of the ASP.NET MVC Rating control to select only one item at a time. When the EnableSingleSelection
property is set to true
, only the selected item will be considered to be in the selected state, while all other items will be unselected.
@using Syncfusion.EJ2.Inputs
@Html.EJS().Rating("rating").Value(3).EnableSingleSelection(true).Render()
public ActionResult SingleSelection()
{
return View();
}
Show or hide reset button
You can reset the rating value to its default by using the AllowReset property of the ASP.NET MVC Rating control. When the AllowReset
property is set to true
, a reset button will be shown that allows the user to reset the rating value to its default.
@using Syncfusion.EJ2.Inputs
@Html.EJS().Rating("rating").Value(3).AllowReset(true).Render()
public ActionResult AllowReset()
{
return View();
}