Object Delayed loading dynamically into Placeholder

M

MattKlepeis

I have a placeholder and I have a section of code that will load a
question into the placeholder depending on what is selected in a group
of dropdownlists.

The problem that I am running into is that the questions that are
loading are for the previously selected request. The questions are not
popping up real time.

Here is my section of code, any help you could give would be greatly
appreciated


protected void ddlRequest_SelectedIndexChanged(object sender, EventArgs
e)
{
//phTextBoxes.Controls.Clear();
int index = ddlRequest.SelectedIndex;
test.Text = index.ToString();
questionSource.SelectCommand = "SELECT assoc_request, question,
question_id, question_num FROM nocsr_question WHERE assoc_request = " +
index;

for (int counter = 1;counter <= ddlQuestion.Items.Count;
counter++)
{
TextBox tb = new TextBox();
tb.Width = 200;
tb.Height = 20;
//tb.TextMode = TextBoxMode.MultiLine;
tb.ID = "TextBoxID" + (counter + 1).ToString();
// add some dummy data to textboxes
tb.Text = "This is textbox " + counter;
phTextBoxes.Controls.Add(new LiteralControl("<b>" +
ddlQuestion.Items.FindByValue(counter.ToString()) + ": </b>"));
phTextBoxes.Controls.Add(tb);
phTextBoxes.Controls.Add(new LiteralControl("<br>"));
Page.
}

}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,017
Latest member
GreenAcreCBDGummiesReview

Latest Threads

Top