Articles in this section
Category / Section

How to render the Syncfusion MVC control without using MVC Resource handlers?

5 mins read

Description

Support is provided to render the Syncfusion MVC controls without using the MVC Resource handler. This feature helps to resolve the issues with Syncfusion control while hosting your application under web Garden/ Server Farm without sticky session.

With the help of MVC Resource handler, you can access/get the appropriate JS files and CSS files to render the Syncfusion control like Upload box while page initiates to loading. Henceforth without proper response (Script file/ CSS file) from Server, the control doesn’t render properly.

Solution

Refer to the following steps to render the Syncfusion controls without using handlers.

  1. Remove the MVC Resource handler reference in both handlers and http handlers under System.webserver and System.web respectively. Refer to the following code example.

web.config

<system.web>
<httpHandlers>
<add verb="*" path=" MvcResourceHandler.axd " type=" Syncfusion.Mvc.Shared.MvcResourceHandler, Syncfusion.Shared.Mvc,  Version=XX.XXXX.X.XX, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89" validate="false" />
</httpHandlers>
</system.web>
<system.webServer>
<handlers>
<add verb="GET,HEAD" name="MvcResourceHandler" path="MvcResourceHandler.axd" type="Syncfusion.Mvc.Shared.MvcResourceHandler, Syncfusion.Shared.Mvc, Version=XX.XXXX.X.XX, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89" />
</handlers>
</system.webServer>

C:\Users\ApoorvahR\Desktop\Note.pngNote: The above handlers should be removed from web.config files, as it can trigger the control to access its resource files from server.

  1. Unzip and include the Script and CSS files that is available in the following location under Scripts and Content folder in your project respectively.

http://www.syncfusion.com/downloads/support/directtrac/general/Dependent_files-2034526219.zip

C:\Users\ApoorvahR\Desktop\Note.pngNote: The above zip contains Scripts and CSS files for tools and grid control related to 12.4.0.24 version

  1. Refer to the dependent Scripts and CSS files in layout page that is included in previous step.

Scripts

CSS

Sf-commonall.min.js

Sf-shared.min.js

Sf-tools.min.js

Sf-grid.min.js

Sf-multicolumndropdown.min.js

sf-CommonCore.css

sf-tools.css

sf-Richtexteditor.css

sf-Menu.css

sf-JQueryUI.css

sf-Rotator-horizontal.css

(or)

sf-Rotator-vertical.css

The above mentioned Scripts and CSS belongs to Tools and Grid controls and it should be referred before to Script Manager in layout page.

C:\Users\ApoorvahR\Desktop\Note.pngNote: Refer to sf-commonall.min.js file as a mandatory to render any Syncfusion controls and maintain same order as mentioned in the above table.

  1. There is no need to render the Style Manager, since you have referred all dependent CSS files in local and then Set Marble theme as default for Syncfusion MVC controls in web.config since attached zip file contains Marble theme Stylesheet only.

web.config

 <appSettings>             
       <add key="SyncfusionTheme" value="Marble" />
  </appSettings>
 

  1. Render and set SkipRegister property to true in Script Manager in layout page. Refer to the following code example.               

Layout

@{Html.Syncfusion().ScriptManager().SkipRegister(true).Render();}

C:\Users\ApoorvahR\Desktop\Note.pngNote: The SkipRegister property is available from Essential Studio volume 3, 2014.

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied