Saturday, March 24, 2012

UpdatePanel and client-side script error in IE, but not in Firefox

<atlas:UpdatePanel runat="server" ID="up" Mode="Always">
<ContentTemplate>
All sorts of controls here
</ContentTemplate>
</atlas:UpdatePanel
I have two DropDownLists. When the user selects an item in the first DropDownList, there is a postback and the 2nd DropDownList gets populated.

All works fine in Firefox 1.5.0.1.

In IE 6, I get this client-side error:
"Assertion Failed: elements in children collection should always have nodeType = 1
Break into debugger?"

And if I break into debugger, the only line is:
"debugger;"

Thanks.Dear,

I have this problem now :)

[],

Ramon Dur?es
It would be nice to post a complete code or at least something distilled down to generate the same error. Both posts claim some issue, but without the code it's difficult for others to investigate this problem.
OK, this was not easy to reproduce. It's a crazy bug :)

<%@. Page Language="C#" %
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
<script runat="server">
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
this.DropDownList2.Items.Add(new ListItem("xyz"));
}
</script
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
<atlas:ScriptManager ID="sm" runat="server" EnablePartialRendering="True" />
</head>
<body>
<form id="form1" runat="server">
<div>
<atlas:UpdatePanel runat="server" ID="up" Mode="Always">
<ContentTemplate>
<asp:DropDownList ID="DropDownList1" runat="server" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged" AutoPostBack="True">
<asp:ListItem>abc</asp:ListItem>
<asp:ListItem>def</asp:ListItem>
</asp:DropDownList><asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="RequiredFieldValidator" ControlToValidate="DropDownList1"></asp:RequiredFieldValidator>
<br />
<asp:DropDownList ID="DropDownList2" runat="server">
</asp:DropDownList>
<!-- remove this to make UpdatePanel work in IE -->
</ContentTemplate>
</atlas:UpdatePanel>
</div>
</form>
</body>
</html
Just remove the HTML comment, and it works!
Hi,

please checkthis thread.
Hi

I have had this problem with the March release. removing thecomments did resolve it. However i dont understand why this is?
I guess its not a big problem to simply not comment in the html but still seems like a strange restriction.

Garbin. You mention in the other thread that the release fileswill not do this and recommend to reference them? I dont follow, i addthe script folder to my project and create a reference to thedll. Then in the config file....
<add tagPrefix="atlas" namespace="Microsoft.Web.UI" assembly="Microsoft.Web.Atlas"/>
<add tagPrefix="atlas" namespace="Microsoft.Web.UI.Controls" assembly="Microsoft.Web.Atlas"/
How do i specifically refrence the release js files?

thanks
o
I got the same problem. I have the latest dll and took all the comments off the page.

I have this textbox that when it posts back it finds the client. If I use it with Firefox it works (after I took off the comments), but if I use IE, it does the search but it freezes up and never shows the information.

Thanks.
Hi,

you could use the ASP.NET notation

<%-- This is a comment --%>

to make comments inside an UpdatePanel.
Now I don't get the error message, but the page freezes up.

I'm using master page, and when I use regular page it works fine and all the fields are completed, with the master page, it finishes the search and that's it, no error message at all.

Thanks.
Hi,

the problem may be related to the id of a control being modified by its container (the MasterPage), but I'm just guessing. Could you post some code?
Thanks for your answer Garbin.

I don't know if this is relative or not, but the master page was using MagicAjax, so I just deleted the MagicAjax Panel from it and it worked.

My guess is the MagicAjax javascript was modifying something. Now it works.
I have the problem too.
and I a another problem.
when I use UpdatePanel on the webPart Zone Control.one webpart zone left a Updatepanel,but when I drop the webpart from a webpart zone area to another.
there will show the message:
"Assertion Failed: Duplicate use of id "WebPart_gwpBookConsumer1" for object of type "Sys.UI.Controls.WebParts.WebPart".Break into debugger?"

The problem exists in Firefox too.

thanks.
same problem here

This is a known issue, and we are currently investigating. See this thread:http://forums.asp.net/thread/1232325.aspx

-Mike


Is fixed in the Atlas April CTP:http://weblogs.asp.net/atlas/archive/2006/04/10/442437.aspx

-Mike

No comments:

Post a Comment