In this article you’ll learn how the current syntax used in Scheduler .NET can be simplified with ASP.NET MVC3 view engine called Razor.

DHTMLX Scheduler .NET can be implemented either in C# or Visual Basic. Razor uses C# or Visual Basic syntax and allows writing HTML with C# or Visual Basic in the same page. We’ll choose C# for this project.

Razor syntax used in Scheduler .NET:

‘@’ character precedes the code and is added inside the HTML markup;

ASP.NET tags <% %> are omitted;

Create a new ASP.NET MVC3 project in Microsoft Visual Studio 2010 and proceed with the following steps:

Set up a database by right-clicking on ‘Your_project_name’ (e.g. mySchedulerApp) -> Add -> Add ASP.NET Folder -> App_Data -> Add New Item and name it “Sample.mdf”;

Add a new table and name it “Event”. It should have the following columns: id, text, start_date, end_date with int, nvarchar(250), datetime and datetime Data Types correspondingly. Set primary key to id and enable the identity column;