RadioButton does not fire event in ASP.NET

Discussion in 'ASP .Net' started by Brano, Nov 14, 2005.

  1. Brano

    Brano Guest

    HI all,

    I have two radioButtons on my form. They both have autopostback = true
    and they are both in the same group. They both have event handlers for
    CheckedChanged event. My problem is ont of them fires ok the other one
    doesn't at all here is the code for them:

    I have tried to delete them drag them from the toolbox again and
    restart VS.NET none helped.

    VB.NET code:

    Private Sub optSettle_CheckedChanged(ByVal sender As System.Object,
    ByVal e As System.EventArgs) Handles optSettle.CheckedChanged
    '# lock and clear other amount
    txtOtherAmount.Text = ""
    txtOtherAmount.Enabled = False


    End Sub

    Private Sub optOther2_CheckedChanged(ByVal sender As System.Object,
    ByVal e As System.EventArgs) Handles optOther2.CheckedChanged
    '# unlock other amount
    txtOtherAmount.Enabled = True
    '# set focus to txtOtherAmount

    End Sub


    ASP.NET code:

    <asp:RadioButton class="GeneralSmall" id="optSettle" runat="server"
    Text="Full amount" GroupName="ba"
    AutoPostBack="True"></asp:RadioButton>


    <asp:RadioButton class="GeneralSmall" id="optOther2" runat="server"
    Text="Other amount" GroupName="ba"></asp:RadioButton>





    THANKS for any help
    Brano, Nov 14, 2005
    #1
    1. Advertising

  2. Have you set AutoPostBack = true for the second one?
    Patrick

    "Brano" <> wrote in message
    news:...
    > HI all,
    >
    > I have two radioButtons on my form. They both have autopostback = true
    > and they are both in the same group. They both have event handlers for
    > CheckedChanged event. My problem is ont of them fires ok the other one
    > doesn't at all here is the code for them:
    >
    > I have tried to delete them drag them from the toolbox again and
    > restart VS.NET none helped.
    >
    > VB.NET code:
    >
    > Private Sub optSettle_CheckedChanged(ByVal sender As System.Object,
    > ByVal e As System.EventArgs) Handles optSettle.CheckedChanged
    > '# lock and clear other amount
    > txtOtherAmount.Text = ""
    > txtOtherAmount.Enabled = False
    >
    >
    > End Sub
    >
    > Private Sub optOther2_CheckedChanged(ByVal sender As System.Object,
    > ByVal e As System.EventArgs) Handles optOther2.CheckedChanged
    > '# unlock other amount
    > txtOtherAmount.Enabled = True
    > '# set focus to txtOtherAmount
    >
    > End Sub
    >
    >
    > ASP.NET code:
    >
    > <asp:RadioButton class="GeneralSmall" id="optSettle" runat="server"
    > Text="Full amount" GroupName="ba"
    > AutoPostBack="True"></asp:RadioButton>
    >
    >
    > <asp:RadioButton class="GeneralSmall" id="optOther2" runat="server"
    > Text="Other amount" GroupName="ba"></asp:RadioButton>
    >
    >
    >
    >
    >
    > THANKS for any help
    >
    Patrick.O.Ige, Nov 14, 2005
    #2
    1. Advertising

  3. Brano

    Brano Guest

    Thanks that was it I was looking for it so long that i couldnt see
    it... THANKS again
    Brano, Nov 14, 2005
    #3
  4. Brano

    rpundlik

    Joined:
    Feb 14, 2010
    Messages:
    2
    Radio Button

    Hi,

    I am also trying the below code but still i am not getting success as i havent raised event handler effeciently.

    can you please tell me how to raise it and use for radio button??

    as i have same below logic for my code.......

    Public Event CheckedChanged As EventHandler
    Dim rb As RadioButton
    Dim hand As EventHandler
    AddHandler rb.CheckedChanged, hand

    Protected Sub RadioButton1_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged


    TextBox5.Enabled = False

    End Sub

    still no success !!!!!!!!!!!!!
    rpundlik, Feb 14, 2010
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Serdar Kalaycý

    asp button click event does not fire

    Serdar Kalaycý, Aug 12, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    4,452
  2. Replies:
    8
    Views:
    4,907
    Lau Lei Cheong
    Mar 11, 2005
  3. Amelyan
    Replies:
    2
    Views:
    672
    Amelyan
    Nov 5, 2005
  4. Replies:
    4
    Views:
    514
  5. Rea Peleg

    asp button click event does not fire

    Rea Peleg, Aug 12, 2004, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    179
    David Alexander
    Aug 12, 2004
Loading...

Share This Page