Author: drkilljoy | Posted on: 7/19/2008 12:36:37 AM | Views : 391

I am trying to add a new row with 3 dropdownlists on each button click. It creates the dropdownlists on the first click but doesn't adds new dropdownlists on further clicking. Anybody knows why? I have written the code for the button click event below. The second problem is that the DDLists dissappear on each postback. How can I create all the DDLists with their respected values like they were before postback? Any help will be great.



int cou = 0;

ctr = Convert.ToInt16(Session["ctr"]);

DropDownList ddl1, ddl2, ddl3;
ddl1 = new DropDownList();

ddl2 = new DropDownList();
ddl3 = new DropDownList();

ddl1.ID = "ddlStations" + Convert.ToString(ctr);

ddl1.EnableViewState = true;
ddl2.EnableViewState = true;

ddl3.EnableViewState = true;
ddl2.ID = "ddlCombo" + Convert.ToString(ctr);

ddl3.ID = ...

Go to the complete details ...