Author: Straeken | Posted on: 7/9/2010 1:46:02 PM | Views : 469

I'm displaying a table based on query results, and each record has a dynamically generated dropdownlist and submit button (and other controls, but this is simplified).  That part works fine, but how do I reference the controls in a function?  Here is the code I've tried.  Create the controls:
Button btnSubmitAction = new Button(); btnSubmitAction.ID = "SubmitAction" + Convert.ToString(DS_RecordID); btnSubmitAction.Command += new CommandEventHandler(SubmitAction_Click); btnSubmitAction.CommandName = "SubmitAction"; btnSubmitAction.CommandArgument = Convert.ToString(DS_RecordID); btnSubmitAction.Text = "Post"; DropDownList ddlType = new DropDownList(); ddlType.ID = "ddlType" + Convert.ToInt32(DS_RecordID); ListItem Item_Blank = new ListItem(); Item_Blank.Text = "Some item"; Item_Blank.Value = "Some item"; Reference the control values (hopefully ...

Go to the complete details ...