Hey There.
Here's my problem:
I have a user control that has client-side code (via the <control
name>.attributes("onclick") = <whatever> property). the "onclick" event is
going to trigger a javascript function to hide and show a <DIV>; the
parameter I pass for this function is the <DIV> id ..
NOTE: There's only ONE DIV in this usercontrol and it's named "pnlSubMenu"
eg. whatever.attributes("onClick") = "showHideDiv('pnlSubMenu');"
Now, since this is in a user control, I want to be able to use this many
times over, but since I need to pass the DIV id to the "showHideDiv" js
function, I need to know how to access the id of the _currently
instantiated_ DIV.
if, for example, I have this user control 3 times in a webform, I notice
that .NET prefixes the id for the 'pnlSubMenu' for each instance with
something like "NavItem?" (so my final id for the instance would be
NavItem1_pnlSubMenu, NavItem2_pnlSubMenu, etc. for each instance of the user
control)
Is there a way to find out the prefix that's gonna be appended at runtime to
the UserControl's control collection?
(Did this question make ANY sense to you guys? :P let me know... )
Max