Click here to Skip to main content
15,881,836 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am Creating Online Exam Project(Asp.Net) in which i have InsertQuestion.aspx Page.
I have 1 textBox and 1 Button ant panel Control.
On Click Of a Button i want to add a Radiobutton dynamically & set the text of Radiobutton as text Of textBox on Every Click Event of a button
And add to a panel control


please tell me Solution.

What I have tried:

AddButton_Click()
{
RadioButton rb = new RadioButton();
rb.Text = Textbox1.Text;
Panel1.controls.add(rb);
}
Posted
Updated 20-Jan-17 0:24am

1 solution

Maintaining dynamic controls is not a trivial process as you have to re-add all of your dynamic controls on every postback, .net can't manage them for you.

Dynamically creating controls | The ASP.NET Forums[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900