How to use the same control

5 posts, 1 answers
  1. Andy Ho
    Andy Ho avatar
    41 posts
    Member since:
    May 2010

    Posted 26 Jul 2010 Link to this post

    I have created 2 docks which load the same .ascx file.

    In the .ascx, there is a button to set the object "tblInput" visible (a table object). But when I click the button on the second dock, the table in the first dock make visible. How to prevent this?
  2. Pero
    Admin
    Pero avatar
    1156 posts

    Posted 28 Jul 2010 Link to this post

    Hello Andy,

    I suppose you are making the table visible with some JavaScript function, and this function resides in the user control. If this is the case, when the user control is added to the same page more than once the same JavaScript function will be added to the page more than once, so the previous definition of the function will be overridden by the last definition. To show this please click the "Alert" button on both docks, and one and the same value will be alerted, when in fact they should be different.
    You can avoid this from happening by dynamically registering the client script from the server. I have implemented this approach in the attached project.

    All the best,
    Pero
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Andy Ho
    Andy Ho avatar
    41 posts
    Member since:
    May 2010

    Posted 28 Jul 2010 Link to this post

    First of all, thanks for your reply.

    I'm not using Javascript to do so, I use server side to make it visible:

    tblInput.visible=true

    I use RadContextMenu, right click "Edit" and then show the Edit table.

  5. Answer
    Pero
    Admin
    Pero avatar
    1156 posts

    Posted 02 Aug 2010 Link to this post

    Hi Andy,

    I modified the project from my previous reply to show/hide the <div/> on the server side, using the Visible property, and everything seems to be working fine. The modified code is attached to the thread.
    I am not sure what might be causing the issue on your side, so please give us more information about the problem. A sample project that demonstrates the issues will help us a lot in finding and providing a working solution.


    All the best,
    Pero
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. Andy Ho
    Andy Ho avatar
    41 posts
    Member since:
    May 2010

    Posted 02 Aug 2010 Link to this post

    Pero,

    Thanks for your reply. Your solution works ok! I've checked the problem exists because I used a GUID as the Dock's ID.

    Andy
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017