Click here to Skip to main content
15,867,568 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Code to count the total number of radio buttons that are selected in asp.net and C#.net.
Posted
Comments
bbirajdar 29-Dec-11 1:39am    
Where do you want it.. on client side or on server side?
Vinod Satapara 29-Dec-11 1:46am    
please be more specific. Which control are you using? RadiobuttonList, Radiobutton?
Can you provide your code sample here?

 
Share this answer
 
For this you have to loop through all radio button controls on the page and keep a counter and increment it for every selected radio button.

Please let us know your motive behind it so we can suggest something better.
 
Share this answer
 
As far as i know only one radiobutton can be selected at a time
so how can you count ???
 
Share this answer
 
Comments
nagendrathecoder 29-Dec-11 1:54am    
Only if all of them are in same group. If we keep radio buttons in different groups then more than 1 can be selected.
bbirajdar 29-Dec-11 4:55am    
@dimpledevani . please post your questions as comments and not as solutions..

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