Question about Client IDs
- by George
I have a user control that is emmitting javascript using the ClientId function. For example:
Out &= "ValidatorHookupControlID(" & Quote & ddlMonth.ClientID & Quote & "), document.all(" & Quote & CustomValidator1.ClientID & Quote & "));" & vbCrLf
It appears to me that the ClientID function DOES not return the ultimate ID that is sent to the browser. Instead, the ClientID function only appears to be aware of its current parent control, which in this case is a the User Control and so the ID that is returned is the ID "dtmPassportExpirationDate_ddlMonth"
When in fact the usercontrol is included in a master page and the ultimate ID that is used is:
"ctl00_phPageContent_dtmPassportExpirationDate_ddlMonth"
I may be nuts, but that's what it appears to be doing. I expect that the ClientID function would return the ultimate ID used in the HTML.
Am I missing something?