We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to render the Schedule control by enabling UnobtrusiveJavaScriptEnabled?

Platform: ASP.NET MVC |
Control: Schedule |
Published Date: February 18, 2015 |
Last Revised Date: May 30, 2019

The following steps help you to add the Schedule control into the MVC application with UnobtrusiveJavaScriptEnabled property set to true in the web.config file. Refer here to Create/Add the EJMVC Schedule in MVC application.

  1. Now, enable the UnobtrusiveJavaScriptEnabled key in the web.config page by setting it to true as follows,

web.config

  <appSettings>
    <add key="webpages:Version" value="3.0.0.0" />
    <add key="webpages:Enabled" value="false" />
    <add key="ClientValidationEnabled" value="true" />
    <add key="UnobtrusiveJavaScriptEnabled" value="true" />
  </appSettings>
  1. When the UnobtrusiveJavaScriptEnabled key is set to true, the ScriptManager rendering code added in the Layout.cshtml page is not required. Therefore, comment or remove the ScriptManager code from the application as follows.

Layout.cshtml

@*@Html.EJ().ScriptManager()*@
  1. Add and refer to the script file ej.unobtrusive.min.js in the Layout.cshtml page as illustrated in the following code example.

Layout.cshtml

<link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" />
    <link href="@Url.Content("~/Content/ej/default-theme/ej.widgets.all.min.css")" rel="stylesheet" />
    <script src="@Url.Content("~/Scripts/jquery-2.1.4.min.js")"></script>
    <script src="@Url.Content("~/Scripts/jsrender.min.js")"></script>
    <script src="@Url.Content("~/Scripts/jquery.easing-1.3.min.js")"></script>
    <script src="@Url.Content("~/Scripts/jquery.globalize.min.js")"></script>
    <script src="@Url.Content("~/Scripts/ej/ej.web.all.min.js")"></script>      
    <script src="@Url.Content("~/Scripts/ej/ej.unobtrusive.min.js")"></script>
  1. Execute the sample and the Schedule control is displayed as follows.

Schedule control

Figure 1: Schedule control

Sample link:

http://www.syncfusion.com/downloads/support/directtrac/131776/ze/ScheduleSampleUnobtrusive-1950530286

2X faster development

The ultimate ASP.NET MVC UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment
Comments
Bill Thomasson
Feb 08, 2017
You should add this to the Getting Started MVC guide. Reply
Karthigeyan Krishnamurthi [Syncfusion]
Feb 27, 2017

Hi Bill,

 

Please check the following link where we have already included that information in UG documentation under the common core topics.

https://help.syncfusion.com/aspnetmvc/unobtrusive

 

 

Regards,

Karthigeyan

 

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon