|
|
Question : how to manipulate two of the same user controls using javascript
|
|
hi,
let's say i am using two of the same user control, MyUserControl. within the control, i have a div, divMyContainer, that i want to make invisible. since now there are two divMyContainer controls, if i am using javascript, only one of them gets modified. my current go around is to create another user control, MyUserControl2, that has exactly the same content as MyUserControl, but with divMyContainer renamed to divMyContainer2, so now javascript can modify two different controls as opposed to two of the same controls. is there a better way to deal with this?
|
Answer : how to manipulate two of the same user controls using javascript
|
|
You can make use of control instead of div control.
So in the javascript just pass the PanelObject.ClientID value. So this ensures that each container is having a unique id and you can make modifications to individual controls dynamically.
Regards,
Chirag
|
|
|
|
|