DayPilot Forums

DayPilot is the best open-source Outlook-like calendar control for ASP.NET.
DayPilot Pro Demo (Calendar control)
» DayPilot Pro live demo (Calendar control)
DayPilot Pro Demo (Scheduler control)
» DayPilot Pro live demo (Scheduler control)
Home » Bugs » DayPilotMonth is undefined

DayPilotMonth is undefined

i am getting this Javascript error "DayPilotMonth is undefined" after getting the 4.6.1389 build from you guys to fix the next month bug yesterday (3/31).

<script type='text/javascript'>
function dpm_Init() {
var v = new DayPilotMonth.Month('DayPilotMonth1'); <--------------error points to this line, script from you guys, not o ur code.

Ian Chan - 4/1/2008 6:02:00 PM
also, same error for daypilotweek and scheduler
Ian Chan - 4/1/2008 6:02:22 PM
hmm, weird, the above error i was getting while setting my date back to yesterday(3/31), now i set it back i am getting a different javascript error. 'HeaderBackColor' is null or not an object on some of my calendars, some works.
Ian Chan - 4/1/2008 6:09:18 PM
also the monthview filesare gone from the demo codes
Ian Chan - 4/1/2008 6:19:27 PM
The "DayPilotMonth is undefined" error can happen in two cases:
  • The JavaScript code is not properly loaded (it's loaded using WebResources.axd reference).
  • There is an syntax error inside the JavaScript code. That prevents the DayPilotMonth class from being defined.
I've tried the build 1389 and it seems that it's not caused by a syntax error (the demo works fine).

I would suggest that you try reloading the page using Ctrl+F5. If that doesn't help, try to look at the actual WebResource.axd content - Firefox + Firebug might help here. There will at least two WebResource.axd references: one defining DayPilotMonth (Month.js in the sources) and common definitions (Common.js in the sources).

It might render ASP.NET exception page instead of the JavaScript code in some cases. It can happen if you use URL redirection, authentication, etc.
Dan Letecky - 4/1/2008 6:28:17 PM
The month view demo was moved from Demo/Calendar/MonthView.aspx to Demo/Month/Default.aspx.
Dan Letecky - 4/1/2008 6:29:56 PM

<script src="/WebResource.axd?d=tH6T-w3oY7ab0jjq_9haMyxj96L4_7VwoGenRl41ulXBLeMD5GyyP-e3b1Vel98w0&amp;t=633426324080000000" type="text/javascript"></script>
<script src="/WebResource.axd?d=tH6T-w3oY7ab0jjq_9haM9iI1_4VetEUReKlmjNEgOui8qNM4eTE1uyeN0bAba-V0&amp;t=633426324080000000" type="text/javascript"></script>
<script src="/WebResource.axd?d=tH6T-w3oY7ab0jjq_9haM102MPbJ0yqj4M_BvKxajlKM5oL6F9IpzuL1xa9UPewd0&amp;t=633426324080000000" type="text/javascript"></script>

i checked all three of these .axd and they all seems to load fine.

My page is as simple as this.

<%@ Page Language="C#" AutoEventWireup="false" CodeBehind="Calendar.aspx.cs" Inherits="Portal.Controls.Shared.Scheduler.Calendar" Title="Event Calendar" %>
<%@ Register Assembly="DayPilot" Namespace="DayPilot.Web.Ui" TagPrefix="DayPilot" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">

</head>
<body>
<form id="form1" runat="server">
<div style="width: 100%">
<asp:ScriptManager ID="ScriptManager1" EnablePartialRendering="true" runat="server" />
<div style="text-align: left"><asp:Literal ID="litName" runat="server"></asp:Literal></div>
<div style="text-align: center; width: 100%">
<asp:Button ID="btnPrev" BorderStyle="Inset" BorderWidth="1px" BorderColor="Navy" ForeColor="Navy" BackColor="White" runat="server" Text="" />
<span style="font-weight: bold; font-size: 1.5em;">
<asp:Literal ID="Literal1" runat="server" Text="Label"></asp:Literal>
</span>
<asp:Button ID="btnNext" BorderStyle="Inset" BorderWidth="1px" BorderColor="Navy" ForeColor="Navy" BackColor="White" runat="server" Text="" />
</div>
<DayPilot:DayPilotMonth ID="DayPilotMonth1" runat="server" ClientObjectName="dpm" BubbleID="bubble" />
<DayPilot:DayPilotBubble ID="bubble" runat="server" Width="250" ClientObjectName="dpb" UseShadow="true"></DayPilot:DayPilotBubble>

</div>
</form>
</body>
</html>

Ian Chan - 4/1/2008 6:49:40 PM
OK, I'm going to test it with your code.
Dan Letecky - 4/1/2008 7:00:11 PM
Oh, sorry. I can see the problem now. This happens only when you don't handle BeforeCellRender event. I'm sending a fixed build.
Dan Letecky - 4/1/2008 7:05:47 PM

with the new build i am getting the DaypilotMonth is undefined again.

loading the .axd (WebResource.axd?d=tH6T-w3oY7ab0jjq_9haMyxj96L4_7VwoGenRl41ulXBLeMD5GyyP-e3b1Vel98w0&amp;t=633426735000000000) gets me this error.

Specified argument was out of the range of valid values.
Parameter name: utcDate

my other scheduler and week view throws same error too.

Ian Chan - 4/1/2008 7:20:13 PM
hmm, it works on my coworker's machine. I think it has something to do with my date time setting on my local.
Ian Chan - 4/1/2008 7:54:57 PM
It seems that this exception is caused by the ASP.NET server system date being smaller than an assembly build date (see also http://www.google.com/search?q=utcDate+specified+argument).
It happens because you are you have set your computer's date to 3/31/2008 and the daypilot.dll build date is 4/1/2008.
Dan Letecky - 4/1/2008 8:20:22 PM
ahh, ok. Everything seems fine now, thank you for the quick response. Appreciate it.
Ian Chan - 4/1/2008 8:24:10 PM
Post reply