Author: MSUTech | Posted on: 7/30/2008 2:54:59 PM | Views : 259

I have a loop that creates dynamic controls (drop down lists), and then I want to reference the values that will be in the dropdownlists... during my programming I get a message that the control does not exist? (NOTE: ultimately I want a user to go through the list of 'dropdownlists' and make selections, then those selections will be written to SQL Server.)

[0] The error that comes up during BUILD: "The name 'ddlSomeList2' does not exist in the current context" 

[1] the creation of the dropdownlist on page_load:

 /** create the dropdownlist for this specific time through the loop **/

DropDownList ddlSomeList = new DropDownList();

ddlSomeList.ID = "ddlSomeList" + i;

/** add each control to the placeholder **/
...

Go to the complete details ...