Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > radio button

Reply
Thread Tools

radio button

 
 
Claudia Fong
Guest
Posts: n/a
 
      09-26-2007
Hi
I have two radio button in my webform. One fo them is selected by
default.
I wrote some simple c# code like this below:

protected void rdoLoad_CheckedChanged(object sender, EventArgs e)
{
if (rdoLoad.Checked == true)
MessageBox.Show("testing OK");

}

But when I was testing, even if I select the other radio button
(rdoLoad), it won't show the message box..

What should I do?

Do I need to write something in my source file of my ASP.NET?

Cheers!

Claudi

*** Sent via Developersdex http://www.developersdex.com ***
 
Reply With Quote
 
 
 
 
md
Guest
Posts: n/a
 
      09-26-2007
It's doing exactly what you told it to. You check if it's true, and show the
message. If it's false (when you select the other radio button) it does
nothing.

"Claudia Fong" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Hi
> I have two radio button in my webform. One fo them is selected by
> default.
> I wrote some simple c# code like this below:
>
> protected void rdoLoad_CheckedChanged(object sender, EventArgs e)
> {
> if (rdoLoad.Checked == true)
> MessageBox.Show("testing OK");
>
> }
>
> But when I was testing, even if I select the other radio button
> (rdoLoad), it won't show the message box..
>
> What should I do?
>
> Do I need to write something in my source file of my ASP.NET?
>
> Cheers!
>
> Claudi
>
> *** Sent via Developersdex http://www.developersdex.com ***



 
Reply With Quote
 
 
 
 
Claudia Fong
Guest
Posts: n/a
 
      09-26-2007
When I say the other radio button I meant the one that I have the code..
Is true and it won't pop up the message box...
I have this 2 radio button define like this

<asp:radiobutton ID="rdoLoad" runat="server" Text="Load"
GroupName="MyGroup" OnCheckedChanged="rdoLoad_CheckedChanged">
</asp:radiobutton>

<asp:radiobutton ID="rdoUnload" runat="server" Text="Unload"
Checked="True" GroupName="MyGroup" OnClick="rdoUnload_Click>
</asp:radiobutton></td>

Cheers!

Claudi

*** Sent via Developersdex http://www.developersdex.com ***
 
Reply With Quote
 
Shelly
Guest
Posts: n/a
 
      09-26-2007

"Claudia Fong" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> When I say the other radio button I meant the one that I have the code..
> Is true and it won't pop up the message box...
> I have this 2 radio button define like this
>
> <asp:radiobutton ID="rdoLoad" runat="server" Text="Load"
> GroupName="MyGroup" OnCheckedChanged="rdoLoad_CheckedChanged">
> </asp:radiobutton>
>
> <asp:radiobutton ID="rdoUnload" runat="server" Text="Unload"
> Checked="True" GroupName="MyGroup" OnClick="rdoUnload_Click>
> </asp:radiobutton></td>
>
> Cheers!
>
> Claudi


Your unload button will only fire if you click it because that is what you
told it to do. It is already set as checked. Unless you click another
button to uncheck it and then re-click it, it will not fire the
rdoUnload_Click event.

Shelly


 
Reply With Quote
 
Claudia Fong
Guest
Posts: n/a
 
      09-26-2007
What unload button?!!??!?

I want to display the message box when I select the load button.

but is not working...

I try to select and deselect the buttons... but is not showing me the
message box..

Cheers!

Claudi

*** Sent via Developersdex http://www.developersdex.com ***
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Align Radio Button text and button tshad ASP .Net 6 11-26-2009 08:52 AM
Radio button that looks like a button? Martin HTML 8 11-24-2009 12:15 PM
[OT: How to broadcast an internet radio on a real radio world wide?] Jan C. Faerber HTML 0 06-30-2009 08:05 AM
ASP.NET Reset Radio Button in a group of Radio Buttons Scott D Johnson ASP .Net 1 09-27-2006 10:38 PM
Radio button List problem: How to find value of Radio button list's Selected Item using javascript?? Hiten ASP .Net Web Controls 1 05-26-2004 10:32 AM



Advertisments