dediğizi yaptım kodları ayrıca şu hale getirdim yine de olmadı
protected void Page_Load(object sender, EventArgs e)
{
if(txtHatSayisi.Text=="" && !Page.IsPostBack)
{
}
else
{
olustur();
}
}
void olustur()
{
Session["HatSayisi"] = txtHatSayisi.Text;
int sayi = int.Parse(Session["HatSayisi"].ToString());
for (int i = 1; i <= sayi; i++)
{
TextBox txtHat = new TextBox();
txtHat.ID = "txtHat" + i.ToString();
txtHat.MaxLength = 10;
txtHat.CssClass = "text";
pnlHatlar.Controls.Add(txtHat);
Literal ltr = new Literal();
ltr.Text = " ";
pnlHatlar.Controls.Add(ltr);
DropDownList ddlPaket = new DropDownList();
ddlPaket.ID = "ddlPaket" + i.ToString();
pnlHatlar.Controls.Add(ddlPaket);
Literal ltrbosluk = new Literal();
ltr.Text = "<br/>";
pnlHatlar.Controls.Add(ltr);
}
}
protected void btnHat_Click(object sender, EventArgs e)
{
olustur();
}