title: i want to find control and add dynamic control to page derived from master page
body: <p>I have tried this code but not able to complete the task, please to help!</p>
  
  <pre><code>public void data()
          {
              string connectionstring = ConfigurationManager.ConnectionStrings["LocalMySqlServer"].ConnectionString;
              using (MySqlConnection con = new MySqlConnection(connectionstring))
              {
  
                  con.Open();
  
                  MySqlCommand cmd = new MySqlCommand("select * from movie;", con);
  
                  MySqlDataReader dr = cmd.ExecuteReader();
  
                  if (dr.HasRows)
                  {
  
                      Control abc = this.FindControl("divv");
  
                      while (dr.Read())
                      {
                          if (abc != null)
                          {
                              Label lbl = new Label();
  
                              abc.Controls.Add(lbl);
  
                              lbl.Text = dr["mv_title"].ToString();
                              //abc.Controls.Add(new LiteralControl("&lt;br /&gt;"));
                          }
                      }
  
                  }
              }
          }
  </code></pre>