Find Control In ASP.NET Content Page


Hello everyone,

Have you ever tried to find an control using Page.FindControl() method in case that this page have a masterpage? if you answer is no, please try it and you will discover that this method won’t return any object, actually there is no direct way to make this.

Although the control is found in the page, ASP.NET consider that the control is located on the content placeholder control of the master page, so you have to get this control using the content place holder of the masterpage not the content control on the current page as following


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s