Question : how to use find control

I can't seem to find a label within a datalist on my page
I'm using this to find it but it will only go as far as the datalist ID
// Find control on page.
            Control myControl1 = Master.FindControl("MainContent").FindControl("RentalPriceDataList");
      if(myControl1!=null)
      {
         // Get control's parent.
         Control myControl2 = myControl1.Parent;
         Response.Write("Parent of the Control is : " + myControl2.ID);
      }
      else
      {
         Response.Write("Control not found");
      }

Answer : how to use find control

Random Solutions  
 
programming4us programming4us