I\'m trying to add controls dynamically
Code:
AddVisaControl.ascx
<%@ Control Language=\"C#\" AutoEventWireup=\"true\" CodeBehind=\"AddVi
Remove static int i = 0;
static int i = 0;
Change the method as below
protected void addnewtext_Click(object sender, EventArgs e) { AddVisaControl ac = (AddVisaControl)Page.LoadControl("AddVisaControl.ascx"); PlaceHolder1.Controls.Add(ac); PlaceHolder1.Controls.Add(new LiteralControl("")); }