Solved to add from dropdownlist,checkboxlist in a textbox multiple
protected void ButtonAddDataBase_Click(object sender, EventArgs e)
{
string dropDownListValue = DropDownListDataBase.SelectedItem.Value;
resultValue += " ";
TextBoxResultDataBaseSkills.Text += Environment.NewLine;
TextBoxResultDataBaseSkills.Text += dropDownListValue + " - ";
foreach (ListItem item in CheckBoxListDataBase.Items)
{
if (item.Text == "Beginner" && item.Selected)
TextBoxResultDataBaseSkills.Text += item.Text;
else
{
if (item.Text == "Medium" && item.Selected)
TextBoxResultDataBaseSkills.Text += item.Text;
else
{
if (item.Text == "Expert" && item.Selected)
TextBoxResultDataBaseSkills.Text += item.Text;
}
}
}
}
Tell me more
×
SharePoint Stack Exchange is a question and answer site for
SharePoint enthusiasts. It's 100% free, no registration required.
|
|
|||||||||||
|
|
You should be doing something like this,
I hand coded this code so there might be some exceptions you should be able to fix, you should also use jQuery to add validations so that only one checkbox is selected all the times and forcing user to select some value in dropdownlist. you will have to set checkbox's ids and text values in asp.net markup if its happening in asp.net otherwise behind code in createchildcontrols methond. You might have to add your controls within a Update Panel so that it won't post back and loose selected values. Here's a question stating how to use update panel in webpart if you don't know already, |
|||||||||||
|
