Within my aspx.cs file I create the following dropdownlist within a placeholder:
/** create the dropdownlist for this specific time through the loop **/
DropDownList ddlSomeList = new DropDownList();
ddlSomeList.ID = "ddlSomeList";
/** add each control to the placeholder **/
placeholderexpertise.Controls.Add(ddlSomeList);
then during the following update statement, I want to reference what value the user has selected, I am trying the following, but, it does not work:
strUpdateQuery1 = "UPDATE ThePersonUPLOAD SET date_modified=GetDate(),expertise=@expertise WHERE person_id=@person_id";
SqlCommand UpdateReviewerCommand = new SqlCommand(strUpdateQuery1, CurrentConnection);
UpdateReviewerCommand.Parameters.AddWithValue("@expertise", placeholderexpertise.ddlSomeList.SelectedValue);