search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Gantt not rendering when deployed to IIS

Asked by Tarak
6 years ago.


im trying to make a little proof of concept using the gantt control, everything seems to be going fine when running in debug on my machine with iisexpress but everything is extremely slow as my dev machine is just a small virtual machine.

however when I try to put my site on an IIS server to see real life performance and have people take a look at my concept to see if it seems to fill the need we had, the gantt chart doesn't render at all, the code to bind goes through fine. but looking at the rendered html the control is just an empty DIV tag.

is this a limitation of the demo?

Answer posted by Dan Letecky [DayPilot]
6 years ago.

There is no limitation built into the demo that would prevent deploying it on IIS.

The rendered code (ASP.NET WebForms) should have three parts:

1. The empty div with id set to the ID of the control. You will find it at the place where you put the control.
2. References to the JS libraries, loaded from URLs that include "/WebResource.axd?"
3. JavaScript initialization code. You will find it at the bottom of the page. It starts with the assembly identification which looks like this:

<script type='text/javascript'>
/* DayPilotPro: DayPilot, Version=8.1.3460.0, Culture=neutral, PublicKeyToken=426941954f05e7fe */

The <script> section should list the settings.

If the Gantt control doesn't appear at all there is probably a JavaScript error that you will see in the browser JS console (Ctrl-Shift-I in Chrome, F12 in IE/Edge).

In Chrome you might see something like:

"Uncaught ReferenceError: DayPilot is not defined(…)"


"Uncaught TypeError: DayPilot.Gantt is not a function(…)"

This means that the libraries from part #2 were not loaded properly. Let the page reload with the Developer Tools enabled and check all WebResource.axd links in the Network tab of the Developer Tools.

The response should contain JavaScript code. You might see a server-side error instead, maybe an exception description. The error message should tell you more about the cause - most likely it's some kind of IIS misconfiguration.

Comment posted by Tarak
6 years ago.

Hello, you are right, there is some javascript errors related to the webresource.axd:

SCRIPT1028: Expected identifier, string or number
File: WebResource.axd, Line: 1, Column: 23800

and then a 2nd one in my page:
function gntPlan_Init() {
var v = new DayPilot.Gantt('gntPlan');
* Object doesn't support this action

I don't see anything weird in the network tab, looks like all the files are transferred properly, 5 webresource and 2 scriptresource.

Comment posted by Dan Letecky [DayPilot]
6 years ago.

Is your IIS configured to automatically minify output with "text/javascript" MIME type? That would explain the different behavior on your local server (I assume the DayPilot.dll is the same).

Comment posted by Tarak
6 years ago.

DLL is indeed the same, im using the "publish" option of visual studio 2015 to copy the files over to the inetpub folder of the destination server.

I haven't enabled any settings to do minification, I did a quick look around in IIS and couldn't see any settings related to this.

I also tried recreating the site from scratch, same result.

Comment posted by Dan Letecky [DayPilot]
6 years ago.

Could you please send the content of the WebResource.axd file (that one with the error) to I'll try to compare it with the correct one.

Comment posted by Dan Letecky [DayPilot]
6 years ago.

Thanks - the script seems to be fine (i.e. it's not modified).

Anyway, the extra comma is removed now in the latest sandbox build (8.1.3467):

Could you please give it a try?

Comment posted by Tarak
6 years ago.

the rendering seems to work better however I am getting new error and some of the formatting(like row height) seems a bit off

heres the new error:
;DayPilot.JSON.stringify=function($1x,$2L,$2M){***if(JSON&&JSON.stringify)***{return JSON.stringify($1x,$2L,$2M);}
I added the *s to point out where it breaks, the message is "'JSON' is undefined. "

Comment posted by Dan Letecky [DayPilot]
6 years ago.

The JSON object should be available in IE8+. It looks like you are using IE to access the IIS site and the IIS URL is in the list of sites to be displayed in compatibility view. Or the IIS site is using a master page with no doctype specified (making the browser run in quirks mode).

That would explain the comma error (modern browsers don't mind that), the broken dimensions and the missing JSON object.

Could that be the problem?

Comment posted by Tarak
6 years ago.

that solved it, the site was in out intranet zone and we have a gpo that defaulted compatibility view. I've added a meta tag to default to edge and everything is working fine now.


Comment posted by Dan Letecky [DayPilot]
6 years ago.

Great, thanks for posting the solution!

This question is more than 3 months old and has been closed. Please create a new question if you have anything to add.