Two components cannot have same id - java script error

2 posts, 0 answers
  1. Prathiba
    Prathiba avatar
    4 posts
    Member since:
    May 2013

    Posted 15 Jul 2013 Link to this post

    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.
  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3602 posts

    Posted 17 Jul 2013 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top