Wednesday, March 28, 2012

UpdateProgress Problem

I am running Atlas on a Win 2K3 Server and I installed the latest version of Atlas today. I created a simple hello world page, which runs as expected. However, when I add an UpdateProgress control and try to view the page, the following two alert boxes appear (in order):

"Assertion Failed: Could not resolve reference to object named "_pageRequestManager" for "dataContext" property on object of type "Sys.Binding"

"Assertion Failed: No data context available for binding with ID"" and dataPath "inPostBack" on object of type "Sys.Binding"

The ASPX page that works correctly is:

<%@dotnet.itags.org. Page Language="C#" AutoEventWireup="true" %>
<script runat="server">
protected void Button1_Click(object sender, EventArgs e)
{
lbTest.Text="Hello World!";
}
</script>
<!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">
<title>Atlas Test</title>
</head>
<body>
<form id="form1" runat="server">
<atlas:ScriptManager id="ScriptManager1" runat="server"></atlas:ScriptManager>

<atlas:UpdatePanel id="update1" runat="Server" Mode="Conditional">
<ContentTemplate>
<asp:Label id="lbTest" runat="server">This is a test</asp:Label>
<asp:Button id="Button1" runat="server" Text="Test Atlas" OnClick="Button1_Click" />
</ContentTemplate>
</atlas:UpdatePanel>
</form>
</body>
</html>

The ASPX page that fails is:

<%@dotnet.itags.org. Page Language="C#" AutoEventWireup="true" %>

<script runat="server">

protected void Button1_Click(object sender, EventArgs e)
{
System.Threading.Thread.Sleep(2000);
lbTest.Text="Hello World!";
}

</script>

<!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">
<title>Atlas Test</title>
</head>
<body>
<form id="form1" runat="server">
<atlas:ScriptManager id="ScriptManager1" runat="server"></atlas:ScriptManager>

<atlas:UpdatePanel id="update1" runat="Server" Mode="Conditional">
<ContentTemplate>
<asp:Label id="lbTest" runat="server"></asp:Label>
<asp:Button id="Button1" runat="server" Text="Test Atlas" OnClick="Button1_Click" />
</ContentTemplate>
</atlas:UpdatePanel>

<atlas:UpdateProgress ID="ProgressIndicator" runat="server">
<ProgressTemplate>
<div id="progressArea">
Loading the data, please wait... <asp:Image ID="LoadingImage" runat="server" ImageUrl="~/img/spinner.gif" />
</div>
</ProgressTemplate>
</atlas:UpdateProgress>
</form>
</body>
</html>

My web.config file looks like this:

<?xml version="1.0"?>

<configuration>

<configSections>
<sectionGroup name="microsoft.web" type="Microsoft.Web.Configuration.MicrosoftWebSectionGroup">
<section name="converters" type="Microsoft.Web.Configuration.ConvertersSection"/>
</sectionGroup>
</configSections>

<microsoft.web>
<converters>
<add type="Microsoft.Web.Script.Serialization.Converters.DataSetConverter"/>
<add type="Microsoft.Web.Script.Serialization.Converters.DataRowConverter"/>
<add type="Microsoft.Web.Script.Serialization.Converters.DataTableConverter"/>
</converters>
</microsoft.web>
<system.web>
<compilation debug="true"></compilation>

<pages>
<controls>
<add namespace="Microsoft.Web.UI" assembly="Microsoft.Web.Atlas" tagPrefix="atlas"/>
<add namespace="Microsoft.Web.UI.Controls" assembly="Microsoft.Web.Atlas" tagPrefix="atlas"/>
</controls>
</pages>

<authentication mode="Forms" ></authentication>

<xhtmlConformance mode="Strict"/>

<httpHandlers>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" type="Microsoft.Web.Services.ScriptHandlerFactory" validate="false"/>
</httpHandlers>
<httpModules>
<add name="ScriptModule" type="Microsoft.Web.Services.ScriptModule"/>
</httpModules>

</system.web>
</configuration>

I pulled the UpdateProgress directly from a sample online, and I can't figure out why it doesn't work.

Can anyone spot any obvious errors? Are there trust issues related to the DLL that holds the UpdateProgress class?

Any help, leads or links would be helpful - thanks.

Update - the first example I posted above DOES NOT WORK. The postback was so fast I mistakenly thought it was working.

No Atlas scripts are working above - anyone have any ideas?


I discovered the problem. I had forgotten to add an "EnablePartialRendering"attribute to true on my ScriptManager.

The first page above had a pagewith just an UpdatePanel. The pageworked, but it posted back instead of updating through atlas. When I added an UpdateProgress, I got thefollowing two error messages:

"Assertion Failed:Could not resolve reference to object named "_pageRequestManager" for"dataContext" property on object of type "Sys.Binding"

"Assertion Failed:No data context available for binding with ID"" and dataPath"inPostBack" on object of type "Sys.Binding"

I couldn't find anyinformation on these error message, and I assumed there was some problem in theinstallation. When I included the "EnablePartialRendering"attribute it solved the problem. I'msure as the Atlas documentation expands, this issue will be covered morethoroughly.

Thaks to Scott Gu and Matt Gibbs for taking some time to respond to my questions about it.
It is possibly related with this problemhttp://forums.asp.net/thread/1243525.aspx

No comments:

Post a Comment