javascript clientID reference in composite control
Hi all!
I have a problem with referencing a clientID in javascript using a composite asp.net control.
I have created a ASP.Net server composite control (navigationMenu)which uses some clientside Javascript. I have set clientside events bij adding attributes to serverside controls, like:
cell.Attributes.Add("onmouseover", "javascript:ShowSubMenu('" & SubMenu.ClientID & "');")
ClientID of the submenu in this case is something like "SubMenu1_2_1"
Works nice but when I run the app the clientID is referred to as:
"_ctl0_NavigationMenu1_SubMenu_1_2_1". (so I get an error, since he cant find the object)
Quite logic, since the controls on the compositecontrol always get the ID of the parent to make it unique.
The problem is: how do I get a reference to "_ctl0_NavigationMenu1_SubMenu_1_2_1"?
I am sure there is an easy way of doing this, but its always hard to find an easy solution. :)
Any ideas anyone?
Thanx in advance!
|