Click here to Skip to main content
15,906,455 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
In my page there are two radio buttons and they are allowing select and unselect of the same radio button. I want to prevent this
Posted
Comments
Karthik_Mahalingam 5-Feb-14 15:37pm    
can u post your code.

From the Question it seems you need to allow only 1 RadioButton to be selected at a time.

If thats the case, use RadioButton.GroupName Property for the RadioButtonlist Control.

Refer

http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.radiobutton.groupname(v=vs.110).aspx[^]
 
Share this answer
 
v2
Comments
phani28 5-Feb-14 8:57am    
Hithanks for the reply
Here the issue is selected radio button is getting unselected when the same radio button is selected
JoCodes 5-Feb-14 9:06am    
You mean to say that you need a read only radiobutton which user should not be able to change?
phani28 5-Feb-14 9:14am    
am having two radio buttons lets say X and Y
when we select X button it should get unselect when we are selecting Y buttonabd vice versa but here it is getting unselect by selecting the same X button
phani28 5-Feb-14 9:21am    
user should be able to change the selection by selecting opposite button
JoCodes 5-Feb-14 10:14am    
Are you using RadioButton COntrol or RadioButtonList? Use RadioButtonList
you can you group name property to make them mutually exclusive. or you can have radio button list instead of two radio button.
 
Share this answer
 
Comments
phani28 5-Feb-14 8:57am    
Hithanks for the reply
Here the issue is selected radio button is getting unselected when the same radio button is selected

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