Please dont give me immediately downvotes, I have same question as asked here, how to assign values to textbox in another method which was dynamically created in c sharp, but FindControl method doesnt exist in current context.
Here is my code
private void btnOkreni_Click(object sender, EventArgs e)
{
TextBox txt = new TextBox();
txt.Name = "txtBoxOpis";
txt.Text = izabrana[0].Opis;
Controls.Add(txt);
}
private void btnSledeca_Click(object sender, EventArgs e)
{
foreach (Karta k in izabrana)
{
if (k == izabrana[0])
{
continue;
}
txtBoxPojam.Text = k.Pojam;
//((TextBox)FindControl("txtBoxOpis")).Text = k.Opis;
}
}