In my condition, i solved by using a prefix as follows:
1: function RowSelectionChanged(sender, eventArgs) {
2: if (sender != null) {
3: // to access a component in this user control
4: var prefix = sender.ClientID.substring(0, sender.ClientID.lastIndexOf("_"));
5: var param1= document.getElementById( prefix + '<%= "_LabelParam1" %>').value;
6: // to access a component in the main page
7: var prefixMainPage = sender.ClientID.substring(0, sender.ClientID.lastIndexOf("MyUserControl"));
8: var param2= document.getElementById(prefixAnaSayfa + '<%= "HiddenParam"%>').value;
9: }
10: }
several possible resolutions proposed in: http://stackoverflow.com/questions/562152/multiple-user-controls-and-javascript, http://stackoverflow.com/questions/2533573/using-getelementbyid-inside-user-control
Hiç yorum yok:
Yorum Gönder