473,388 Members | 1,480 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

C#-Web: Cannot unregister updatepanel with ID XXX since it was not registered ....

Hi,

I need to add a 'WebDialog' component on to a webpage everytime a user clicks on a button.

This is the error I'm getting: Cannot unregister UpdatePanel with ID 'dialog0_UpdateContainer' since it was not registered with the ScriptManager. This might occur if the UpdatePanel was removed from the control tree and later added again, which is not supported.
Parameter name: updatePanel

I get the error here: PlaceHolder1.Controls.Add(myDialog);

Here is my code behind(c#):

public partial class MultipleWindows : System.Web.UI.Page
{
ArrayList arrayList;

protected void Page_Load(object sender, EventArgs e)
{
arrayList = (ArrayList)Session["dialogs"];
if (arrayList == null)
{
arrayList = new ArrayList();
}
}

public void Button_OnClick(Object sender, System.EventArgs e)
{
//Create new web dialog
C1WebDialog dialog = new C1WebDialog();
dialog.ContentUrl = TextBox1.Text;

//Set the id
int len = arrayList.Count;
dialog.ID = "dialog" + len;

//add it to the collection of Dialogs
arrayList.Add(dialog);
Session["dialogs"] = arrayList;

//loop thru collection of dialogs and paint each one out
for(int index=0; index<arrayList.Count;index++)
{
C1WebDialog myDialog = (C1WebDialog)arrayList[index];

// Add to the page's controls
PlaceHolder1.Controls.Add(myDialog);

// Set open dialog handler
HyperLink HyperLink1 = new HyperLink();
HyperLink1.NavigateUrl = String.Format("javascript:openWindow($get(\"{0}\") );", myDialog.ClientID);
}

}


}

Here is page code:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="MultipleWindows.aspx.cs" Inherits="MultipleWindows" %>
<%@ Register Assembly="C1.Web.C1WebDialog.2" Namespace="C1.Web.C1WebDialog" TagPrefix="c1d" %>


<html>

<head runat="server">
<script type="text/javascript">
var form_dialog;
function openWindow(dialog)
{
form_dialog = dialog.control;
dialog.control.show();
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
<asp:TextBox ID="TextBox1" runat="server" Text="http://www.yahoo.com"></asp:TextBox>&nbsp;&nbsp;
<asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button_OnClick"/>
</div>
</form>

</body>
</html>


Any ideas anyone?
Thanks
Jan 23 '08 #1
0 4993

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Ricky Jones | last post by:
Is there any way to unregister a ActivatedClientType? thanks, Ricky Jones
5
by: richard.tallent | last post by:
I'm fond of web controls in ASP.NET, but the need for <@ Register%> blocks at the top of each page is a pain. ASP.NET 2.0 has a way to centrally register controls in the web.config file, but it...
16
by: Heinz K | last post by:
Hello all, I'm developing a vb.net 2.0 webservice which accesses a lotus notes database using lotus domino api. This works fine on my local client if I select "Use Visual Studio Development...
2
by: ChrisCicc | last post by:
Hi All, I got a real doozy here. I have read hundreds upon hundreds of forum posts and found numerous others who have replicated this problem, but have yet to find a solution. Through testing I have...
3
by: =?Utf-8?B?UmljaA==?= | last post by:
I created a custom dll to use .net objects in com environment. It works fine. Then I copied the dll to another workstation and manually registered it, and it works fine there also. Now I need to...
1
by: =?Utf-8?B?U3Rvcm1icmluZ2Vy?= | last post by:
I have an UpdatePanel with a dropdown list that I can't seem to get to update. It has a hidden button which I click from javascript added to the page when another update panel is updated. Triggers...
5
by: Leon Mayne | last post by:
Having a bit of trouble here. I know that if you want to use a fileupload control inside an AJAX update panel then you need to create a trigger for the control that performs the uploading postback...
1
by: jack | last post by:
Hi folks, I got a custom control, in which it's placed inside the UpdatePanel. The control contains some LinkButtons which post back to the same page. Actually, when these LinkButtons are clicked,...
2
by: eebee | last post by:
Hi, I've been trying for a few hours now, but cannot resolve this: In IE7 it works, but not in : I'm using a HoverMenuExtender in a Listview. As soon as I'm using an updatepanel, the popup...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.