title: accessing controls created by CreateChildControls()
body: <p>I need to access the controls created by CreateChildControls() from another class, so that when I choose the file I have the path on a string to refer to.</p>
  
  <p>I have tried the solutions in <a href="https://stackoverflow.com/questions/2982198/accessing-controls-created-dynamically-c">Accessing controls created dynamically (c#)</a> and <a href="https://stackoverflow.com/questions/3362188/problem-in-accessing-dynamically-created-controls">Problem in accessing dynamically created controls</a>  But with no joy  thanks</p>
  
  <pre><code>    publicTextBox txtUrl; 
  
      protected override void CreateChildControls()
      {
          Label lblUrl = new Label();
          lblUrl.ID = "lblUrl";
          lblUrl.Text = "Url: ";
          Controls.Add(lblUrl);
  
          TextBox txtUrl = new TextBox();
          txtUrl.ID = "txtUrl";
          Controls.Add(txtUrl);
  
          AssetUrlSelector picker = new AssetUrlSelector();
          picker.ID = "ausUrl";
  
          picker.DefaultOpenLocationUrl =  OpenUrl;
          picker.AssetUrlClientID = txtUrl.ClientID;
          picker.AssetUrlTextBoxVisible = false;
          Controls.Add(picker);
  
          Control control = Page.LoadControl(_ascxPath);
          Controls.Add(control);
  
      }
  </code></pre>
  
  <p>From another class I should be able to access the textbox</p>
  
  <pre><code>   protected void Button1_Click(object sender, EventArgs e)
      {
          AssetPicker asspi = new AssetPicker();
  
          string aaa = asspi.txtUrl.Text;
  
  
  
      }
  </code></pre>