ASP.NET Controls: ClientID

If you are using a control hierarchy that implements INamingContainer, when the controls render to a browser the ID property (viewed from the html source) will not be the same as the ID you have set programatically (by doing myControl.ID, the ID will be prefixed). To overcome this, you can access the clientid property of a webcontrol (which gives you the id of a control as rendered to the browser).

Note that the clientid will not be correct if you try to obtain it before the control is added to the controls hierarchy.

See the following article for more details

You May Also Like

About the Author: rnowik

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.