I'm creating composite control, which has two other components that rely on each other.
In component A (image), I access component's B (input) UniqueID which equals
MyTextBox1$BoldTextBox
I use it in onclick JavaScript code...
But in rendered HTML input element has following id
MyTextBox1_BoldTextBox
So my javascript code , generated inside composite control has something like this:
onclick=$('#MyTextBox1开发者_Python百科$BoldTextBox').....
instead of:
onclick=$('#MyTextBox1_BoldTextBox').....
Could somebody please explain what is happening, and how can I reliably associate those two controls ?
Thanks , Paweł
You want the ClientID
property instead of the UniqueID
property.
The reason for this is (sort of) explained on Atanas Korchev's blog post "The difference between Id, ClientID, and UniqueID".
精彩评论