G
Guest
Is it possible to include a textbox control inside of a radiobuttonlist item? Below is my attempt, but didn't work. when i say "didn't work"... it did not get an error message, but the textbox was not displayed. The code snippet represents what is inside of a loop that is building the survey form. Any thoughts
//adding the radiobuttonlist listitem her
ListItem li = new ListItem()
li.Value = AryAnswers[j,1]
li.Text = AryAnswers[j,2]
rbl.Items.Add(li)
//any additional controls
//here is where i check an array value... if it has a value, that mean
//I need to add a child control. for example, the is a survey form and mos
//answers are simply radio buttons, but sometimes the survey user may nee
//to select a radio button such as "Other.....[textbox here]
if (AryAnswers[j,3] != null && AryAnswers[j,3] != ""
string ControlName = AryAnswers[j,3]
switch (ControlName.Substring(0,3)
case "Txt"
TextBox txt = new TextBox()
txt.ID = ControlName
rbl.Controls.Add(txt)
break
PhQuestions.Controls.Add(rbl)
//adding the radiobuttonlist listitem her
ListItem li = new ListItem()
li.Value = AryAnswers[j,1]
li.Text = AryAnswers[j,2]
rbl.Items.Add(li)
//any additional controls
//here is where i check an array value... if it has a value, that mean
//I need to add a child control. for example, the is a survey form and mos
//answers are simply radio buttons, but sometimes the survey user may nee
//to select a radio button such as "Other.....[textbox here]
if (AryAnswers[j,3] != null && AryAnswers[j,3] != ""
string ControlName = AryAnswers[j,3]
switch (ControlName.Substring(0,3)
case "Txt"
TextBox txt = new TextBox()
txt.ID = ControlName
rbl.Controls.Add(txt)
break
PhQuestions.Controls.Add(rbl)