Click here to Skip to main content
15,886,748 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Friends I need a help from you. I have a form that contain lots of radio button with diffrent group name . i need a reset button to clear all radiobutton . plz help me. i dont want javascript code i am useing c# languge web application.
Posted

try:

C#
protected void btnClear_Click(object sender, EventArgs e)
{
    //This one call clear method to clear all control values
    clear();
}


C#
void clear()
{
    foreach (Control c in form1.Controls)
    {
        
        //Clear all radio buttons
        if (c is RadioButton)
            ((RadioButton)c).Checked = false;       
    }
}
 
Share this answer
 
v2
Comments
Pravin Patil, Mumbai 19-Apr-12 4:57am    
Good solution..
My 5.
Bibin Benny 19-Apr-12 5:37am    
I am Using ContantPage. so i cant directly apply this ..
check these links..

radiobutton[^]

RadioButton[^]

radiobuttonlist[^]
 
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