Dialog inside Updatepanel inside Repeater

This post has 37 replies

Top 500 Contributor
Posts: 17
hainesy82 Posted: Thu Dec 6, 2007 @ 7:11 AM
I have a Repeater which contains an UpdatePanel, which in turn contains a Dialog.

The dialog displays fine until I do a callback on the updatepanel. Then i get the following 2 errors when trying to display the dialog:

Sys.InvalidOperationException: Type ComponentArt.Web.UI.Dialog has already been registered.
[Break on this error] if (window.__registeredTypes[typeName]) throw Error.invalidOperation(Str...
ScriptResource.ax... (line 700)

and

Sys.ScriptLoadFailedException: The script 'http://localhost/Serenity.Web.Gambia.PackageWebsite/Docs/SearchHolidays/ComponentArtScript.axd?f=u1,u5,c1,c2,d1,d2&v=2007_2_1272_3' failed to load. Check for: Inaccessible path. Script errors. (IE) Enable 'Display a notification about every script error' under advanced settings. Missing call to Sys.Application.notifyScriptLoaded().
[Break on this error] throw Sys._ScriptLoader._errorScriptLoadFailed(scriptElement.src, mu...


Any ideas?
Top 10 Contributor
Posts: 6,149
stephen Posted: Thu Dec 6, 2007 @ 1:11 PM
I'll try to recreate this for debugging- can you elaborate on what you have a bit more? From what I understand, you have a repeater. There is a template within the repeater that contains an updatepanel and a dialog. What inside of the template is causing the postback? What is dialog doing in this scenario?
Stephen Hatcher, Developer Support Manager
Top 500 Contributor
Posts: 17
hainesy82 Posted: Fri Dec 7, 2007 @ 12:55 AM
Okay well it's a little more complicated in that I have

1. A CompositeControl with an ItemTemplate that binds this to a Repeater
2. Inside the ItemTemplate I have an UpdatePanel
3. Inside the UpdatePanel a DialogUserControl - which is a UserControl containing a Dialog Control.

A button from within a seperate CompositeControl inside the updatepanel is doing the callback. This composite control contains a repeater, so the button is within a repeater!

The callbacks work fine on their own. And the dialogs work fine prior to callback. But after callback they produce the javascript errors described.
Top 500 Contributor
Posts: 17
hainesy82 Posted: Fri Dec 7, 2007 @ 5:42 AM
Okay well it seems to be a wider problem to do with the script combination, with UpdatePanel and MasterPage.

I have a simple Test page inside a MasterPage. Here's the source code to reproduce the error:

Master Page:
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="TestMaster.master.cs" Inherits="TestMaster" %>
<!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">
    <body>
        <form id="Form1" runat="server">
            <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
            <asp:contentplaceholder id="SecondaryMaster" runat="server"></asp:contentplaceholder>
        </form>
    </body>
</html>


Test.aspx:
<%@ Page Language="C#" MasterPageFile="TestMaster.master" AutoEventWireup="true" CodeFile="Test.aspx.cs" Inherits="Test" %>
<asp:Content ID="Content1" ContentPlaceHolderID="SecondaryMaster" Runat="Server">
        <%= DateTime.Now.ToLongTimeString() %>
        <asp:UpdatePanel id="DepartureUpdatePanel" runat="server">
            <ContentTemplate>
                <asp:Button ID="Callback" Text="Callback" runat="server" />
                <%= DateTime.Now.ToLongTimeString() %>
                <ComponentArt:Calendar ID="TestCalendar" runat="server"></ComponentArt:Calendar>
            </ContentTemplate>
        </asp:UpdatePanel>
</asp:Content>


Something to do with the combination of these two controls?

Hope you can fix it! For now I have just taken the line out of my Web.Config and it works fine, but obviously for release I'll be hoping you can get this fixed!

Thanks

Chris
Top 10 Contributor
Posts: 6,149
stephen Posted: Fri Dec 7, 2007 @ 1:41 PM
I have the developers looking into this now- apparently, they believe the scripts are being sent twice, which shouldn't occur, obviously. I'll post back again when I get an update.
Stephen Hatcher, Developer Support Manager
Top 10 Contributor
Posts: 6,424
hwan Posted: Tue Dec 11, 2007 @ 11:52 AM
I tried the code quoted above but was not able to reproduce the issue. For reference, here's the Web.config I used. ComponentArt.Web.UI.dll version 2007.2.1272.3, System.Web.Extensions.dll version 1.0.61231.0, Visual Studio 2005. Web.config:
TestMaster.master: <%@ Master Language="C#" %> Test.aspx: (Note: I added a reference to the ComponentArt controls) <%@ Page Language="C#" MasterPageFile="TestMaster.master" %> <%@ Register TagPrefix="ComponentArt" Namespace="ComponentArt.Web.UI" Assembly="ComponentArt.Web.UI" %> <%= DateTime.Now.ToLongTimeString() %> <%= DateTime.Now.ToLongTimeString() %>
Top 500 Contributor
Posts: 17
hainesy82 Posted: Wed Dec 12, 2007 @ 1:21 AM
Interesting... I stripped back my web.config, and the problem still occurs.

The only difference is I am using Extensions 1.0.61025.0

Not sure where you get this newer version from?

Chris
Top 10 Contributor
Posts: 6,424
hwan Posted: Fri Dec 14, 2007 @ 1:40 PM
Ah, sorry, it IS 1.0.61025.

Here's what I see:

"System.Web.Extensions.dll"
Assembly Version: 1.0.61025.0
File Version: 1.0.61231.0
Product Version: 1.0.61231.0

I think the 1.0.61231.0 is the designer version?
Top 10 Contributor
Posts: 865
sberkovitz Posted: Mon Dec 17, 2007 @ 5:29 PM
I actually had this problem when first experimenting with the CA script handler, but eventually aborted when I ran into other problems.
Steven Berkovitz MBC Development Ltd. & OrderDynamics Corporation http://www.mbccs.com http://www.orderdynamics.com
Top 500 Contributor
Posts: 17
hainesy82 Posted: Tue Dec 18, 2007 @ 1:00 AM
Hmm well I don't know what else could be different...
Top 10 Contributor
Posts: 865
sberkovitz Posted: Tue Dec 18, 2007 @ 6:35 AM
Can you try without the CA Script handler?

Remove
<add type="ComponentArt.Web.UI.ScriptHandler,ComponentArt.Web.UI" path="ComponentArtScript.axd" verb="*" />


from your web.config
Steven Berkovitz MBC Development Ltd. & OrderDynamics Corporation http://www.mbccs.com http://www.orderdynamics.com
Top 10 Contributor
Posts: 6,149
stephen Posted: Wed Dec 19, 2007 @ 1:39 PM
We also released a new build today with some changes to scripthandler- can you grab the latest release from our download page and let us know if this is addressed for you?
Stephen Hatcher, Developer Support Manager
Top 500 Contributor
Posts: 17
hainesy82 Posted: Thu Dec 20, 2007 @ 4:08 AM
The new release did not fix the problem.

Taking out the ComponentArt ScriptHandler caused a Sys.ScriptLoadFailedException

-- the code was still trying to access ComponentArtScript.axd

Chris
Top 10 Contributor
Posts: 6,424
hwan Posted: Thu Dec 27, 2007 @ 12:03 PM
For those who are still having this issue, can you compare and report any differences between your rendered page and mine as quoted below? The only definite difference should be the "20071227_hwan" application path, and the WebResource id. Oh, and I guess the time reported. Untitled Page
[ 2:53:05 PM
2:53:05 PM
]
Top 500 Contributor
Posts: 17
hainesy82 Posted: Fri Dec 28, 2007 @ 3:34 AM
Aha! I have found the problem...

My master page is inside a folder called "Templates", so the script source for the ComponentArtScript.axd looks like this:

<script src="Templates/ComponentArtScript.axd?f=u1,u5,c1,c2,d1,d2&amp;v=2007_2_1302_3" type="text/javascript"></script>

If I put my MasterPage in the root with the Test page it works fine.

So there is a bug somewhere that doesn't like the MasterPage being inside a folder

Chris
Page 1 of 3 (38 items) 1 2 3 Next >