Thanks for your reply, but I actually found a solution that works well for
me.
I basically set a JavaScript variable to <%=ID%>. Then, I have the base ID
of the User Control and can then append that to any controls IDs that I
reference in Script. The only thing that I don't understand is why some
controls have a colon (:) between the UserControl ID and the Child Control
ID, and other IDs use an underscore (_)? Is there any rhyme or reason to
this?
--
-----------------------------------
Ken Varn
Senior Software Engineer
Diebold Inc.
Emailed = varnk
Domain = Diebold.com
-----------------------------------
"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
You must determine this on the server side using MyControl.ClientID.
Then pass this ID to your client side code so it can use it.
--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Ken Varn" <nospam> wrote in message
news:eH**************@TK2MSFTNGP12.phx.gbl...I have created a User Control (ASCX) and I need to be able to do some
JavaScript on the HTML side on some controls that are in the User
Control. How do I get the ID of the Controls within a User Control? Asp.net
appends
each control with the ID of the ASCX control. Some controls are in the
format of ParentID:ControlID, and others are in the format of
ParentID_ControlID. Is there some method in JavaScript to determine the
true ID of the control with the pre-pended ASCX ID?
--
-----------------------------------
Ken Varn
Senior Software Engineer
Diebold Inc.
EmailID = varnk
Domain = Diebold.com
-----------------------------------