Cannot set the handler to my image

2 posts, 0 answers
  1. Julien
    Julien avatar
    236 posts
    Member since:
    Jul 2010

    Posted 21 Nov 2011 Link to this post


    I need to do a demo for tomorrow using your ajax dock control.

    But I've got some problem by only trying to reproduce your sample.

    You have a method "OnClientInitialize" which call the javascript method "SetHandleDock".

    But in this method:
    function SetHandleDock(dock, args) {
                dock.set_handle(document.getElementById("Handle_" + dock.get_id()));

    with the dock.get_id(), I receive something like "with the dock.get_id(), I receive something like 

    Because it's looks like that has changed my id(which was on start the RadDock1).

    Then, when trying to get the element by id, will try to access to "Handle_ct100_MainContent_RadDock1" which doesn't exist, the one which exist has the name Handle_RadDock1.

    How to avoid this behavior? Can I eventually specify to the RadDock the handle's id?

  2. Slav
    Slav avatar
    1351 posts

    Posted 23 Nov 2011 Link to this post

    Hi Julien,

    Indeed, the id of the dock controls in the online demo Dock / Set Drag Handle Client-side is constructed depending on the particular setup. If a RadDock is placed in a container, the ASP.NET generates its client id based on its position in the page.

    To avoid this behavior you can use an ASP Image control as a handle, because its client id is constructed via the same patten, used for the RadDock's id. You can find attached a sample project, implementing the suggested solution. Please use it as a base for your further development.

    the Telerik team
    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 their blog feed now
  3. DevCraft R3 2016 release webinar banner
Back to Top