How to
28 Mar 2018 / 1 minute to read
Render RadialSlider from Code behind
RadialSlider can be rendered from the code behind by initializing the required properties in controller and passing those properties via ViewData or Model to the client side.
The following code illustrates the initialization of RadialSlider properties in the controller.
//Namespace to get the JavaScript (RadialSlider) component properties
using Syncfusion.JavaScript.Models;
namespace MvcApplication.Controllers
{
public class RadialsliderController: Controller
{
public ActionResult RadialSliderFeatures()
{
//Initializing the RadialSlider model
RadialSliderProperties sliderObj = new RadialSliderProperties();
//Initializing the other properties
sliderObj.StrokeWidth = 4;
sliderObj.ShowInnerCircle = true;
sliderObj.InnerCircleImageUrl = "http://js.syncfusion.com/demos/web/content/images/radialslider/chevron-right.png";
//Passing RadialSlider properties using the ViewData
ViewData["RSliserModel"] = sliderObj;
return View();
}
}
}
Binding the RadialSlider properties passed via ViewData from the controller in the client side as below.
@{
Html.EJ().RadialSlider("Radialslider1", (Syncfusion.JavaScript.Models.RadialSliderProperties)ViewData["RSliserModel"]).Render();
}
Was this page helpful?
Yes
No
Thank you for your feedback!
Thank you for your feedback and comments. We will rectify this as soon as possible!
An unknown error has occurred. Please try again.
Help us improve this page