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

Cannot set the handler to my image

1 Answer 34 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Julien
Top achievements
Rank 1
Julien asked on 21 Nov 2011, 11:22 AM
Hi,

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 
"ctl00_MainContent_RadDock1"

Because it's looks like that asp.net 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?

1 Answer, 1 is accepted

Sort by
0
Slav
Telerik team
answered on 23 Nov 2011, 01:09 PM
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.

Regards,
Slav
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
Tags
Dock
Asked by
Julien
Top achievements
Rank 1
Answers by
Slav
Telerik team
Share this question
or