I am successfully referencing other controls on my page like this:
var category = document.getElementById("<%= lstCategory.ClientID %>");
However, this does not work for my SAVE button.
var btn= document.getElementById("<%= btnSave.ClientID %>");
alert(btn)
Alert displays "null".
So, I displayed the source after the page is rendered. And this is the ID for the SAVE button: ctl00_PageContent_btnSave__Button
So, I did this:
var btn= document.getElementById("<%= ctl00_PageContent_btnSave__Button.ClientID %>");
But this fails at runtime with the following error:
'ctl00_PageContent_btnSave__Button' is not declared.
So, if the declared ID is different than the generated ID, how does one reference this control via Javascript??
Thanks.
Our community of experts have been thoroughly vetted for their expertise and industry experience.