Hai
Iam Using a webimagebutton in a webform which is inherited from a masterpage.The problem iam faicing is that, iam not able to acess the webimagebutton in javascript.
i think this is because the id of the control will change when it is used inside a mastre page and i have to refer the webimagbutton using its clientid.
Can any body help me in, how i can get the clientid of the web image button in javascript .
Regards
Rajesh Kamalakshan
<script>
var buttonClientId = '<%=igButton.ClientID;%>';
</script>
HI ,
Veiw the source code of the page, this will help you determine the clientID.
For a webimagebutton in a master page - refer to it as
ctl00_WebImageButton1
For an webimagebutton in a contentplaceholder - refer to it as
ctl00_ContentPlaceHolder1_WebImageButton1
ASP controls are rendered using different ID's from the one declared.
If, for example, you have the button called 'btnTest' and that button is one a web page which has a master page, then the button is actually contained in a ContentPanel on the web page.
To refer to it you would have to use code like :-
var myButton = document.getElementbyId("ctl00_ContentPlaceHolder1_btnTest");
If the button is further nested in other controls in the web page, then it can get more complex.