It seems that Session is not properly constituted on the first async (UpdatePanel) post back for the Session. I have narrowed this down to a simple example:
Create a new AJAX enabled Web
Add an UpdatePanel
Add a Button to the Update Panel.
In the Button Click method add an item to the Session (i.e. Session["a"] = "a";)
you will get an Page Request Manager Parser Error on the first click but no error on a subsequent click. If you wait for the Session to expire the error will occur one time again.
You can get around the problem by adding an empty Global.asax to your project or adding code to set any value in the Session in the Page_Load method.
I have the Visual Studio 2005 SP1 installed and the "release" version of all the ASP.NET AJAX components.
Sample aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<div>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
</body>
</html>
Sample cs file:
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
Session["sv"] = "SomeValue";
}
}
Seems like an realy big bug for a "Production" release.