Click here to Skip to main content
15,891,938 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How can I get the text of unselected radiobuttons?

Suppose we have 3 radiobuttons A, B and C. A is selected but I want to get the text of radiobutton C. Could anyone please help me with this?
Posted
Updated 20-Sep-11 1:06am
v3
Comments
jim lahey 20-Sep-11 7:04am    
Improved question, removed textspeak.

You can use the Text property of the radio button. e.g. You can get the text of C radio button then use c.Text, where c is the name of the radio button.

Refer the full example of Radio Button and Check Box at http://www.homeandlearn.co.uk/csharp/csharp_s4p12.html[^]

Hope this helps.
All the best.
 
Share this answer
 
Loop through all radio button in page and get it's values.

C#
 foreach (Control control in Page.Controls)
 {
     RadioButton  rbControl = control as RadioButton ;
     if (rbControl != null)
     {
         Page.Title =  rbControl.Text //get text of radio button
     }
}
 
Share this answer
 
v2

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