Rank: Advanced Member Groups: Member
Joined: 3/16/2010 Posts: 101
|
Hi,
I use two FileExplorer controls (with different IDs) in my master page. One is directly on the page, the other is within a dialog. The first one works like a charm, but when I open the dialog, I receive a "function_GetObject encountered multiple objects with the same id..." error message (The second FileExplorer then displays correctly within the dialog).
I believe it might be the "FolderTree" treeviews inside each of the FielExplorer's templates, but the name "FolderTree" needs to be used to have the FileExplorer control to work. Is there a way around this?
Thanks for your help.
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
You will need to change the argument (in this case "FolderTree") to the full ClientID, instead of just ID. When there is only one control with the given ID, GetObject will work fine with that ID. However when two controls with the same ID (they are always inside different naming containers because the same naming container would not allow duplicate IDs) appear in the same page, you must pass the control's full ClientID to GetObject in order to distinguish them.
There are a number of ways to get the controls' ClientID. If your control structure is fixed, you can just view your HTML source code to find out the full ID. Another method is to call FindControl on your server side to find the TreeView control, then access its ClientID property. A third method is to handle the TreeView's ClientSideOnLoad event with JavaScript. The client side control object (in this case the client side TreeView object) is passed to your handler as the first argument. You can then call getId on that object to get the full client ID.
Hope this helps.
Thanks
|
Rank: Advanced Member Groups: Member
Joined: 3/16/2010 Posts: 101
|
Hello,
Of course. I did not realize that I got a eo_GetObject statement on that control from the layout I copied from your sample.
Sorry for the silly question and thank you for your great support.
|