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

Two components cannot have same id - java script error

1 Answer 95 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Prathiba
Top achievements
Rank 1
Prathiba asked on 15 Jul 2013, 06:00 AM
Hi,

  We are having a custom label control, which is having a Rad tool tip as it's child control. When the control is rendered in page, it is rendered as below,

<span class="aspLabelWithoutFocus" id="SV_704d8aa8-7ffb-4904-8ac0-1715793d4b89_ctl01_OnFocusEvents">

<div style="display: none; position: absolute;" id="SV_704d8aa8-7ffb-4904-8ac0-1715793d4b89_ctl01_OnFocusEvents_RadTooltip1" class="tooltipStyle">

 <input id="SV_704d8aa8-7ffb-4904-8ac0-1715793d4b89_ctl01_OnFocusEvents_RadTooltip1_ClientState" name="SV_704d8aa8-7ffb-4904-8ac0-1715793d4b89_ctl01_OnFocusEvents_RadTooltip1_ClientState" type="hidden" autocomplete="off">

</div>

<span class="aspLabelWithoutFocus" onmouseover="this.className='cssClassMouseOver'" onmouseout="this.className='aspLabelWithoutFocus'"></span>

</span>




  After this if we try to update the lable text from jquery. It is updated successfully, but if we have a post back after that, when the page is reloaded we get a javascript  error as "Two components with same id<RadToolRip's id> cannot be added" .

  This control is being rendered within update panel. Please help us in resolving this issue.

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 17 Jul 2013, 11:03 AM
Hello Prathiba,

Such an error means that the control is not disposed. Another possible reason is that it is added twice by the custom code you have. I have not seen such issues with the control in update panels which means there is something specific in the scenario/code that is not working properly with respect to disposing script controls. You can consider manually calling the dispose() method of each RadToolTip through the scriptManager.


Regards,
Marin Bratanov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
ToolTip
Asked by
Prathiba
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or