If you are using master pages, you may expect that you can find a control within an tag with the following
But unfortunately that doesn’t work.
You need to make a reference to the place holder the control is in, then find the control within the place holder.
Another gotcha here is that you need to find this control based on the id it has on the master page not the id it has in the page in question.
If the tags on the page are
<asp:content id="Content2" contentplaceholderid="cphMain" runat="Server">
You need to create a reference to the place holder with
Dim myContentPlaceHolder As ContentPlaceHolder myContentPlaceHolder = CType(Master.FindControl("cphMain"), ContentPlaceHolder)
Dim myContentPlaceHolder As ContentPlaceHolder myContentPlaceHolder = CType(Master.FindControl("Content2"), ContentPlaceHolder)
Hope that saves someone some time!