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

DayPilotNavigator and updatepanel, DropDownList1_SelectedIndexChanged Error: JScript runtime

Asked by Anonymous
11 years ago.

I tried to put a drop down list in an update panel and then display the employee schedule in the calendar accordingly.
The calendar also has a DayPilotNavigator.

When I first hit the dropdown list, everything is right.
But the second time I select a different employee, I got the following javascript error.
And the DropDownList1_SelectedIndexChanged method no longer working.

I used the latest DayPilotProTrial-7.3.2841.
The problem is DayPilotNavigator .
It works fine without it.
DayPilotNavigator causes the javascript error when there is a update panel
You can put a break point at

int a =123;

to see the error
The following is my code with all the unnecessary removed.
//********************
ERROR MESSAGE
Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Index and length must refer to a location within the string.
Parameter name: length

///////////////////////////////////////////////////////
using System;
using System.Data;

namespace WebApplication2
{
public partial class WebForm1 : System.Web.UI.Page
{

protected void Page_Load(object sender, EventArgs e)
{

}

protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
int a =123;
}
}
}
////////////////////////////////////////////////////////////
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication2.WebForm1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register Assembly="DayPilot" Namespace="DayPilot.Web.Ui" TagPrefix="DayPilot" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
<asp:ListItem Selected="True">zero</asp:ListItem>
<asp:ListItem>first</asp:ListItem>
<asp:ListItem>second</asp:ListItem>
<asp:ListItem>third</asp:ListItem>
</asp:DropDownList>
<br />

</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="DropDownList1" EventName="SelectedIndexChanged" />
</Triggers>
</asp:UpdatePanel>

<DayPilot:DayPilotNavigator ID="DayPilotNavigator1" runat="server" />
</div>
</form>
</body>
</html>
/////////////////////////////////////////////////////////////////////

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

It seems that DayPilotNavigator.Render() is called by .NET framework although the navigator is not inside the UpdatePanel. This causes the init script to be called with every partial PostBack.

This error message is a side effect. I'm investigating the issue.

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

This bug is fixed now in build 7.3.2854. You can download it in the sandbox:

http://www.daypilot.org/sandbox/

Please let me know if there is any problem.

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