Click here to Skip to main content
12,304,203 members (67,952 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: ASP.NET
I would like to be able to check/select a radiobutton and then uncheck/deselect(if they select the wrong filed by chance) . Is there a way to do this in asp.net?
Posted 25-Jan-11 0:20am
Edited 25-Jan-11 1:37am
v4
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 3

I will suggest you to use Checkbox control where you can actually do what you have asked.
But radio button is only that you want to use refer following code :

bool blnState;
 
public Form1()
{
    InitializeComponent();
}
 
private void radioButton1_MouseDown(object sender, MouseEventArgs e)
{
    blnState = radioButton1.Checked;
}
 
private void radioButton1_MouseUp(object sender, MouseEventArgs e)
{
    radioButton1.Checked = !blnState;
}

where radioButton1 is the name of the radio button that you are using.
I have used the mousedown and mouseup events of this control.
  Permalink  
Comments
sam, atlanta 31-Jan-11 13:08pm
   
It worked correctly pravin...
Pravin Patil, Mumbai 1-Feb-11 1:19am
   
congrats sam
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

can u explain clear

-----

i think, this is help u use Radio Button List and Select Autopostback true.
  Permalink  
v2
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

Are you talking about OnCheckedChanged event[^]

As said by Vinoth you need to set autopostback property to true.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160530.1 | Last Updated 25 Jan 2011
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100