LightSwitch for HTML Client

Visual Studio LightSwitch is a development environment designed to simplify and shorten the business applications and data services. LightSwitch makes it easy to create data-centric business applications that can consume a variety of data sources and create clients that can run on a variety of devices.

Key Features

  1. Build HTML5-based apps that run on all modern devices
  2. Consume and aggregate multiple data sources like databases, SharePoint and OData
  3. Eliminate plumbing code and focus on what makes your application unique

Refer to the following links to get more information about LightSwitchHTML Client:

Refer to the following links to know how to create a simple LightSwitchHTML Application.

Steps for installation of EJ LightSwitch HTML Extension


  1. Visual Studio 2012 (Update 2 or greater) must be installed before attempting to install TheEssential Studio for LightSwitch HTML product.
  2. If you have older versions of EJ LightSwitch extensions installed, you should uninstall them before installing newer versions.
  3. Before installing Essential Studio for LightSwitch HTML product, it is recommended that you do the following:

    a. Download and Install 2012:

    Visual Studio 2012 SDK:

    LightSwitch Extensibility Toolkit:

    b. Download and Install For 2013:

    Visual Studio 2013 SDK:

    LightSwitch Extensibility Toolkit :

  4. Once you install the LightSwitch Extensibility Toolkit, complete the following:

    LightSwitch Extensibility Toolkit unzipped folder contains the following list of files.


  5. Double click the Microsoft.LightSwitch.Toolkit.vsix present in the unzipped folder.
  6. Copy the Microsoft.LightSwitch.Toolkit.targets from this zip into the specific location.
  7. The Location is mentioned in the README Document.

The Essential Studio for LightSwitch HTML product is downloaded from the following link:

From the given location you can download the setup file (exe file) of LightSwitch HTML product. To know the step-by-step process of the installation, check here.

Getting Started with EJ LightSwitch HTML Extension

EJ LightSwitch HTML Extension has screen templates and design-time extensions to use EssentialJavaScript components in LightSwitchHTML Application in Microsoft Visual Studio 2013 or Microsoft Visual Studio 2012 (Update 2 or greater). Once the LightSwitch Extension is installed, you can access to the screen templates and custom controls at design time.

There are two types of extensions provided in the Essential JavaScript components in LightSwitchHTML Application.

  1. Web for HTML LightSwitch: It gives access to the web controls like DatePicker, TimePicker, Grid, etc. in the LightSwitchHTML application at design time.
  2. DataVisualization for HTML LightSwitch: It gives access to the Data Visualization controls like Chart, BulletGraph, Maps, etc. in the LightSwitchHTML application at design time.

The following controls are included in the Essential Studio for LightSwitch HTML.

  1. Grids
    • DataGrid
  2. Data visualization
    • Chart
    • BulletGraph
    • Map
    • TreeMap
    • Radial Gauge
    • Linear Gauge
    • Digital Gauge
    • RangeNavigator
  3. Editors
    • Textbox
    • Autocomplete
    • RichTextbox
    • Masked Textbox
    • Rating
    • Slider
    • DropDownList
    • DatePicker
    • TimePicker
    • DateTimePicker
  4. Notification
    • Progress Bar

Configure the EJ LightSwitch HTML Extension

You can create the application with the controls by configuring the settings manually without the default template.

Create Your First LightSwitch HTML Application

  1. Open Visual Studio 2013 or Visual Studio 2012.
  2. Open File New Project.
  3. In the New Project Dialog, expand the Installed Templates Visual C# and select LightSwitch HTML application. Then enter the desired name for the project and the location.

The LightSwitch HTML application appears as follows.

Adding the EJ LightSwitch Extension

  1. In the LightSwitchHTML projects, select the project Properties.

  2. In the Properties dialog box, go to the Extensions tab in project properties and ensure that the extensions shown in the graphic appear and then select the extension in the Properties

When the extension named Web for HTML LightSwitch is checked, it gives access to the web controls like DatePicker, TimePicker, Grid, etc in the LightSwitchHTML application at design time. You can also select the Use in new projects fields, if desired. To use the Data Visualization controls like Chart, BulletGraph, Maps, etc., check the extension named DataVisualization for HTML LightSwitch.

Adding the CSS and Script references

You need to include the widgets CSS style sheets and script files in the application to render the controls in client-side.

CSS References

The dependent widget CSS files are copied from the following Essential JavaScript installed location:

<Installed Location>\Syncfusion\Essential Studio\\JavaScript\assets\css\web

The above mentioned folder contains the Core and ThemeCSS files for the web widgets. You need to copy the files from the above mentioned location and add it to your project location. While loading the CSS files into your application, it is maintained in the folder structure as it is in the web folder of the source location. \Content\.  Include the reference of the default ej.web.all.min.css styles into the default.html head section that is located in the default-theme folder.

Script References

The dependency script files can be copied from the following installed location:

<Installed Location>\Syncfusion\Essential Studio\\JavaScript\assets\external

The necessary dependency script files are as follows,

  • jQuery (from the version 1.7.1 to 3.1.0)
  • jquery.easing.1.3.js
  • jsrender.js

It is copied from the above mentioned location and added to the scripts folder section of your project location as follows: \Scripts. Include the script references in the default.html as follows.


From V13.4.0.53 onwards, jQuery.globalize.min.js file has been replaced with our script file ej.globalize.min.js to support the globalization for our widgets. For version lesser than, refer jQuery.globalize.min.js. There is no necessary to refer ej.globalize.min.js explicitly since it is available in ej.web.all.min.js script file. Besides jQuery.easing external dependency has been removed from version onwards. Kindly include this jQuery.easing dependency for versions lesser than

The Widget source files are copied from the following installed location,

<Installed Location>\Syncfusion\Essential Studio\\JavaScript\assets\scripts\web

The ej.web.all.min.js script file contains all the web widgets. This is added in the following mentioned folder structure of your project \Scripts\ej. Include the Syncfusion EJ Scripts references to default.html after base dependency scripts as follows.

For CDN Users

You can also refer to the scripts directly from CDN location before speeding up the loading time. Refer to the following CDN locations and add them in the default.html file of your project. 

  • javascript
  • <!-- Dependent CSS for Essential JavaScript Components -->
        <link href="" rel="stylesheet" />
        <!-- Dependent Scripts for Essential JavaScript Components --> 
    <script src=""></script>
        <script src=""></script>
        <script src=""></script>
        <script src=""></script>

    The CDN link contains the Syncfusion CDN file lists and other information about the CDN links.

    Add the Control in the Application

    The following steps describe how to render the DatePicker control in the LightSwitchHTML application.

    1. Create a new Browse Screen and do not bind any data source to the screen. Set the Browse screen as Home Screen in that application.
    2. Click Add Data Item and Select the Local property. Then add the local property with specified data type. Now, the local property named DatePickerValue of type Date is added.

    3. Drag the DatePickerValue property onto the screen designer.

    4. Select the DatePickerValueLocal Property in the designer and change its control type as EJ Value control.

    5. EJ Value control has a list of controls to render. Select the control to be rendered with this content item. Now it is changed as DatePicker Control. The Control List is present in the properties panel.


      You need to choose an appropriate control based on the data type of the content item. For example, do not assign date value to Numeric and Currency Text Box.

    6. Click Edit Render Code link in the properties panel.

    7. The following code example is generated automatically while clicking the Edit Render Code in the properties panel. The Source code is editable.

           myapp.Browse.DatePickerValue_render = function (element, contentItem) {
           // Input element to render DatePicker control.
           var input= $('<input />');
           input.attr('id', 'DatePickerValue');
           input.attr('data-role', 'none');
           // Renders DatePicker control with input element.
           change: function (args) { contentItem.value = args.value;} });
           contentItem.dataBind('value', function (value) {
           input.ejDatePicker({ value: value })  });
    8. You can change the type of control continuously. Do not assign the unsupported data values to the controls.
    9. Run the Application and it creates the ejDatePicker control on the screen. The DatePicker control appears as follows.

    10. The above generated code block renders the default DatePicker.
    11. You can modify the generated code to suit your needs because the generated code is editable.

    Sample details

    This section explains the default location of the installed samples and describes the procedure to run the samples through the sample browser and online.


    If you have changed the default location of the samples, you can refer from the changed location.

    Samples Installation Location

    The LightSwitch HTML samples are installed in the following location:

    For 64-bit:

    Run the samples

    1. To run the samples, open the corresponding Dashboard from the following location:

      Start Menu-> All Programs -> Syncfusion -> Essential Studio <> -> Dashboard

    2. You can also open the Dashboard from the installed location also:

      C:\Program Files (x86)\Syncfusion\Essential Studio\\Infrastructure\Dashboard\4.0\Dashboard.exe

    The following screenshot shows the Dashboard.

    To run the locally installed samples, click on Run Local Samples button, and to run the online samples click on Run Online Samples button from the top right corner.

    Configuring Syncfusion NuGet Packages in Visual Studio

    Syncfusion LightSwitch HTML NuGet packages are available here.

    NuGet Configuration

    The steps to install the Syncfusion LightSwitch HTML NuGet Packages in Visual Studio are as follows,

    1. In Visual Studio, navigate to Tools | NuGet Package Manager | Package Manager Settings, the options dialog will appear on the screen as shows below,

    2. Select NuGet Package Manager | Package Sources and click Add button to add the Package Name and Package Source of Syncfusion NuGet Packages.

      Name: Name of the package that listed in Available package sources
      Source: Syncfusion LightSwitch HTML NuGet Package feed url


      The Source text box in the above image denotes the location of the NuGet packages and the Name section, allows you to provide a unique name for NuGet Packages Source.


    Syncfusion other platforms NuGet packages feed links are available here

    NuGet Installation

    Syncfusion LightSwitch HTML NuGet can install once configured the package source. The NuGet installation steps as below,

    1. Once configured the Package source with Syncfusion NuGet Packages, right click on project and choose Manage NuGet Packages | Online | <Package Source Name>.

    2. The NuGet Packages are listed which are available in package source location. Install the required packages to your application by clicking Install button.


      NuGet packages can be install directly through the command line (Package Manager Console). Further details click here

    Updating a NuGet Package

    Using the Manage NuGet Packages in Visual Studio, NuGet packages can be update.

    1. Right click on Project and Navigate to the Manage NuGet Packages and click on the Updates tab to check for updates.

    2. Select the Updates -> <Syncfusion Package Source>. Refer to the following screenshot for more information.

    3. If there is a new version of NuGet you will see it in the list of available updates.

    4. Select NuGet Package in the list and click Update. When the update is complete, close and re-open all open instances of Visual Studio.


      By clicking Update All button, all NuGet packages are getting update. When the update is complete, close and re-open all open instances of Visual Studio.