Click here to Skip to main content
15,893,668 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am using a placeholder in my code, And dynamically adding an asp table having radio buttons in the rows at run time.

Once user selects the required radio button I need to get the selected radio button on a button click event. But the code is throwing me an error stating null object reference !

Please help me in solving this problem.. How can i retrieve the selected value of radio button ..

Population of table has to done dynamically as I am using Ajax to navigate to next set of radio buttons in the asp table if required value does not appear at first.

Thanks in advance !

Regards,
Divya
Posted

1 solution

If you add control dynamically in that case you need to preserve the state of the control by yourself. For more details you can check following article.

Retaining State for Dynamically Created Controls in ASP.NET applications[^]

The other way around is to get the values of the control from Request.Form[“ControlName”]
 
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