Orientation in EJ 1 ASP.NET MVC Rotator

8 Aug 2017 / 1 minute to read

The Rotator control supports both vertical and horizontal orientations allowing it to fit into any scenario. The Orientation property defines the Orientation where the control is rendered. The value set to this property is enum or string type. It accepts the following values.

  • ej.Orientation.Horizontal or “Horizontal”
  • ej.Orientation.Vertical or “Vertical”

The following steps explain you how to set Orientation for the Rotator.

Horizontal

This property sets the Rotator in HorizontalOrientation. You can refer the following steps to set Horizontal Orientation for Rotator control. In Rotator control, the Default value of Orientation is Horizontal.

  1. In View, create ul-li list of Rotator items and invoke the Rotator helper.
  2. Add the following script in your CSHTML page.
  • cshtml
  • // Add this code in your CSHTML page and refer local data section for binding Rotator items.
    
    @Html.EJ().Rotator("sliderContent").Datasource((IEnumerable<LocalData>)ViewBag.datasource)
    .RotatorFields(t => t.Text("Text").Url("Url"))
    .SlideWidth("600px")
    .SlideHeight("350px")
    .Orientation(Syncfusion.JavaScript.Orientation.Horizontal)

    Vertical

    This property sets the Rotator in vertical orientation. You can refer the following steps to set VerticalOrientation for Rotator control.

    1. Create ul-li list of Rotator items and invoke the Rotator helper.
    2. Add the following script in your CSHTML page.
  • cshtml
  • // Add this code in your CSHTML page and refer local data section for binding Rotator items.
    
    @Html.EJ().Rotator("sliderContent").Datasource((IEnumerable<LocalData>)ViewBag.datasource)
    .RotatorFields(t => t.Text("Text").Url("Url"))
    .SlideWidth("600px").SlideHeight("350px")
    .Orientation(Syncfusion.JavaScript.Orientation.Vertical)