This is a migrated thread and some comments may be shown as answers.

Sys.InvalidOperationException: A control is already associated with the element.

8 Answers 765 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Suzi
Top achievements
Rank 1
Suzi asked on 03 Oct 2008, 07:57 AM
Hi,

I use telerik components and Ajax.Net. I have a strange error when I click on the grid : Sys.InvalidOperationException: A control is already associated with the element.

<

asp:Content ID="Content1" ContentPlaceHolderID="cl" runat="server">

<asp:UpdatePanel runat="server" ID="upd1"><ContentTemplate>
// RAD GRID used here, inside the FlashInfoGrid  component.
</ContentTemplate></asp:UpdatePanel>

</

asp:Content>

 <

asp:Content ID="Content2" ContentPlaceHolderID="cb" runat="server">

<

asp:UpdatePanel runat="server" ID="upd2"><ContentTemplate>
// Control to display when I click on the Edit button of the RadGridView.
</ContentTemplate></asp:UpdatePanel>

</

asp:Content>

Maybe, the UpdatePanel doesn't ork very well with the RadGrid of Telerik ? Or maybe, I don't use the UpdatePanel correctly ? Maybe I should use the RadAjaxManager of Telerik ?

Thank you in advance,

8 Answers, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 06 Oct 2008, 06:22 AM
Hello Suzi,

This is a general MS AJAX error which is widely discussed on the web as you can see from the search results. You could try the results provided in here : A control is already associated with the element

Greetings,
Maria Ilieva
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Monalisa
Top achievements
Rank 1
answered on 13 Jul 2009, 12:29 PM
Hi,

I face the same problem. Could any body help me.
Below is my code:

<

telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">

 

 

<AjaxSettings>

 

 

<telerik:AjaxSetting AjaxControlID="RadAjaxManager1">

 

 

<UpdatedControls>

 

 

<telerik:AjaxUpdatedControl ControlID="RadGrid1" />

 

 

</UpdatedControls>

 

 

</telerik:AjaxSetting>

 

 

<telerik:AjaxSetting AjaxControlID="RadGrid1">

 

 

<UpdatedControls>

 

 

<telerik:AjaxUpdatedControl ControlID="RadGrid1" />

 

 

</UpdatedControls>

 

 

</telerik:AjaxSetting>

 

 

</AjaxSettings>

 

 

</telerik:RadAjaxManager>

 

 

<asp:UpdatePanel ID="up" runat="server"><ContentTemplate>

 

 

<telerik:RadGrid

 

 

OnItemCreated="RadGrid1_ItemCreated"

 

 

ID="RadGrid1"

 

 

runat="server"

 

 

AllowPaging="True"

 

 

Width="97%"

 

 

DataSourceID="SqlDataSource1" Skin="Office2007"

 

 

onitemdatabound="RadGrid1_ItemDataBound"

 

 

AllowMultiRowSelection="true" AllowFilteringByColumn="true"

 

 

AllowSorting="true" ShowFooter="true"

 

 

EnableLinqExpressions="false" GridLines="None">

 

 

<PagerStyle Mode="NextPrevAndNumeric" />

 

 

<GroupingSettings CaseSensitive="false" />

 

<

HeaderContextMenu Skin="Office2007" EnableTheming="True">

 

<

CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>

 

</

HeaderContextMenu>

 

 

<PagerStyle Mode="NumericPages" />

 

 

<MasterTableView

 

 

AutoGenerateColumns="False"

 

 

DataKeyNames="PK_ID"

 

 

ClientDataKeyNames="PK_ID"

 

 

Width="100%"

 

 

CommandItemDisplay="Top"

 

 

PageSize="10" >

 

<

RowIndicatorColumn>

 

<

HeaderStyle Width="20px"></HeaderStyle>

 

</

RowIndicatorColumn>

 

<

ExpandCollapseColumn>

 

<

HeaderStyle Width="20px"></HeaderStyle>

 

</

ExpandCollapseColumn>

 

 

<Columns>

 

 

 

..............
</
Columns>

 

<

EditFormSettings>

 

<

EditColumn UniqueName="EditCommandColumn1"></EditColumn>

 

</

EditFormSettings>

 

 

<CommandItemTemplate>

 

 

..................

 

 

</CommandItemTemplate>

 

 

</MasterTableView>

 

 

<ClientSettings EnableRowHoverStyle="true">

 

 

<ClientEvents OnRowContextMenu="RowContextMenu" />

 

 

<Selecting AllowRowSelect="true" />

 

 

 

<ClientEvents OnRowDblClick="RowDblClick" />

 

 

</ClientSettings>

 

<

FilterMenu Skin="Office2007" EnableTheming="True">

 

<

CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>

 

</

FilterMenu>

 

 

</telerik:RadGrid>

 

 

<telerik:RadWindowManager ID="RadWindowManager1" runat="server">

 

 

<Windows>

 

 

<telerik:RadWindow ID="UserListDialog" runat="server" Title="Editing record" Height="550px"

 

 

Width="980px" Left="0px" ReloadOnShow="true" ShowContentDuringLoad="false" Modal="true" />

 

 

</Windows>

 

 

</telerik:RadWindowManager>

 

 

<asp:SqlDataSource ID="SqlDataSource1" runat="server"

 

 

.......
></
asp:SqlDataSource>

 

 

<telerik:RadContextMenu ID="RadMenu1" runat="server" OnItemClick="RadMenu1_ItemClick">

 

 

<Items>

 

 

<telerik:RadMenuItem Text="Open" />

 

 

<telerik:RadMenuItem Text="Edit" />

 

 

<telerik:RadMenuItem Text="Delete" />

 

 

</Items>

 

 

</telerik:RadContextMenu>

 

 

</ContentTemplate></asp:UpdatePanel>

 

0
Iana Tsolova
Telerik team
answered on 13 Jul 2009, 02:32 PM
Hi Monalisa,

Please try removing the ASP:UpdatePanel and see if the error persists.
I suggest that you use either RadAjax or ASP:UpdatePanel controls for ajaxifying same page content but both.

I hope this helps.

Best wishes,
Iana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Hanan
Top achievements
Rank 1
answered on 16 Dec 2009, 02:25 PM
hi all,
actually i got the same problem but in different secnario, in rad grid filters like date ( calendar), i got the error when i picked a date from the calender and clicked ok and it is closed, but i expanded ithe calendar again and i left it open, then i clicked on the filter icon
or button ,  i got the execption shwon in the screen shot i have attached along.

i search alot to fix it, and i found a solution saying " use radscriptmanager instead of scriptmanager", i gave it a go, and  it worked for me but actually i couldn't use the radscriptmanager for many reasons, i need a solution with the scriptmanager.
0
Iana Tsolova
Telerik team
answered on 18 Dec 2009, 10:06 AM
Hello Hanan,

I followed your scenario and prepared a sample project attached to this post. However it works fine on my side. Could you please specify what differs on your case?

Kind regards,
Iana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Hanan
Top achievements
Rank 1
answered on 18 Dec 2009, 03:30 PM
thanks for your reply,
this a brief description:
i put the script the scriptmanager on the master page, and the radgrid is on the content page, these the steps to reproduce the exception:

1) pick a date from the calendar, and open it again and leave it open.
2) click on the filter button to get the result.
3) the calendar is still open.
4) you are supposed to get it.

as i have said, i got it only witht he scriptmanager but i use radscriptmanage, everything is going very well...

any ideas...!

thanks,
hanan
0
Iana Tsolova
Telerik team
answered on 19 Dec 2009, 09:51 AM
Hello Hanan,

I modified the sample following your steps in order to replicate the issue but to no avail. Please try the attached project and let me know if you can observe the unexpected behavior there and what differs in your case.

Sincerely yours,
Iana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Rahul
Top achievements
Rank 1
answered on 13 Oct 2015, 04:43 AM
Facing the same problem in .Net GridView
Tags
Ajax
Asked by
Suzi
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Monalisa
Top achievements
Rank 1
Iana Tsolova
Telerik team
Hanan
Top achievements
Rank 1
Rahul
Top achievements
Rank 1
Share this question
or