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

DayPilotNavigator vs Update panel crash with lib vers 7.2

Asked by Anonymous
11 years ago.

Created a empty page, added a Navigator control and a button.
The button is in a seperate UpdatePanel.
When button is clicked, server is called handle click.

In this case, first time you click the button, a second Navigator control appears on screen.
Second time you click on the button, the server throws the exception:
Sys.WebForms.PageRequestManagerServerErrorException: Index and length must refer to a location within the string.
Parameter name: length

this was using build : 7.2.2786.1
using the build that comes with the tutorials (5.xyz) the behaviour is not present and works fine.

Here is the code:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<%@ 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 id="Head1" runat="server">
<title>Untitled Page</title>
<link href='CalendarStyling.css' type="text/css" rel="stylesheet" />
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server" />

<DayPilot:DayPilotNavigator ID="DayPilotNavigator1" runat="server" />

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Click Me!"
UseSubmitBehavior="False" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
</body>
</html>

and

using System;
using System.Data;

public partial class _Default : System.Web.UI.Page
{
private DataTable _db;

protected void Page_Load(object sender, EventArgs e)
{
_db = new DataTable("Events");
_db.Columns.Add(new DataColumn("eventStart", typeof (DateTime)));
_db.Columns.Add(new DataColumn("eventEnd", typeof(DateTime)));
_db.Columns.Add(new DataColumn("name", typeof(String)));
_db.Columns.Add(new DataColumn("id", typeof(int)));

var row = _db.NewRow();
row[0] = DateTime.Now.AddHours(1);
row[1] = DateTime.Now.AddHours(2);
row[2] = "Event 1";
row[3] = 1;
_db.Rows.Add(row);
_db.AcceptChanges();

if (!IsPostBack)
{
DataBind();
}
}

protected void Button1_Click(object sender, EventArgs e)
{
//lblHelloWorld.Text = "Hello, world - this is a fresh message from ASP.NET AJAX! The time right now is: " + DateTime.Now.ToLongTimeString();

}
}

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