Adding Multiple/Another Control to an Update Panel

suteISUK

New Member
I have seen a lot of threads on this. I may not understand or I havent found the right answer. I have a user create a control, they give it a name, they give it a type (textbox, checkboxlist, radiobuttonlist, or just a label). if it is a checkboxlist or radiobuttonlist they can either add values to it by typing in each value in a text box, or i give them a custom set of values ie Mr. Mrs. Miss. Then they click a button and put the control in an update panel. this all works fine. but then I have them create another control and add it to the update panel. when they add the second control, the first one disappears. How can I keep the first control in the update panel? and if they add a third, i need to keep the first and second in the update panel.I have read about viewstate but I do not completely understand. Any help would be greathere is the code to add a radio button list with a set of predefined values, ie mr mrs etc. the control actually goes into a panel first, then the update panel. im using juice ui to make the controls draggable and the only control you can make draggable is a panel. when i put one panel in the update panel, it works perfectly\[code\]DALpredefinedValue newSet = new DALpredefinedValue();newSet.PredefinedValueSetID = valueSetID;DataTable predefinedValueSet = DALpredefinedValue.getPredefinedValue(newSet); RadioButtonList rad = new RadioButtonList(); for (int i = 0; i < predefinedValueSet.Rows.Count; i++) { DataRow predefinedValue = http://stackoverflow.com/questions/15731264/predefinedValueSet.Rows; rad.Items.Add(predefinedValue.Field<String>("name")); } rad.ID = "rad" + controlIDs + panelCounter; panel.Controls.Add(rad); upForm.ContentTemplateContainer.Controls.Add(panel);\[/code\]
 
Back
Top