New to Telerik UI for ASP.NET Core? Download free 30-day trial

Telerik UI Timeline in RazorPages

RazorPage is an alternative to the MVC pattern that makes page-focused coding easier and more productive. It consists of a cshtml file and a cs file (generally the two files have the same name). The Telerik UI Timeline for ASP.NET Core can be integrated in such an application seamlessly.

For a runnable example, refer to the Timeline in RazorPages example.

Getting Started

To bind the Telerik UI Timeline to a data set within a RazorPage:

  1. Setup the Read URL in the DataSource. The URL should refer the name of the method in the PageModel.

        .DataSource(dt => dt
            .Read(r=>r.Url("/Timeline/TimelineBinding?handler=Events"))
        )
    
        <datasource>
            <transport>
                <read url="/Timeline/TimelineBinding?handler=Events" />
            </transport>
        </datasource>
    
  2. Within the .cs file, introduce ActionMethod to return the data set:

        public JsonResult OnGetEvents()
        {
            return new JsonResult(Events);
        }
    

See Also

In this article