protected void lbtnadd_Click(object sender, EventArgs e) { if (ViewState["addmoreEdu"] != null) { myCount = (int)ViewState["addmoreEdu"]; } myCount++; ViewState["addmoreEdu"] = myCount; for (int i = 0; i < myCount; i++) { TextBox txtboxcustom = new TextBox(); Literal newlit = new Literal(); newlit.Text = "<br />"; txtboxcustom.ID = "txtLandline" + i.ToString(); PnlLndline.Controls.Add(txtboxcustom); PnlLndline.Controls.Add(newlit); } }
for (int i = 0; i < 5; i++) { lblText.Text = lblText.Text + Request.Form["txtLandline" + .ToString()].ToString() + "<br />"; }
foreach (Control item in testpnl.Controls) { if (item.GetType().Name == "TextBox") { string val = ((TextBox)item).Text; } }
string cntrlid= string.Empty; for (int i = 0; i <= form1.Controls.Count; i++) { cntrlid = " txtLandline" + i.ToString(); TextBox txt = form1.FindControl(controlid) as TextBox; if (txt!= null) { ------------ } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)