ASP.NET radio button change

后端 未结 5 705
孤独总比滥情好
孤独总比滥情好 2021-01-04 02:50

I am trying to figure out why this code doesn\'t fire the radio button change event.

here\'s the ASP page code for 2 radio buttons

  

        
相关标签:
5条回答
  • 2021-01-04 03:06

    You'll need to specify the attribute and value AutoPostBack="true" in order to tell ASP.NET that changing of that element should trigger a postback. It should be applied to each individual RadioButton which you wish to cause a postback.

    0 讨论(0)
  • 2021-01-04 03:11

    You should add the AutoPostBack=True attribute to both controls.

    0 讨论(0)
  • 2021-01-04 03:12

    You should set the AutoPostBack = True and in the code behind the handles in your function.

    Example:

    Protected Sub RadioButton1_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs)           Handles RadioButton1.CheckedChanged
    
    0 讨论(0)
  • 2021-01-04 03:13

    I would use RadioButtonList instead. And set AutoPostBack=true for what you want to do.

    0 讨论(0)
  • 2021-01-04 03:26

    you have to specify the AutoPostBack=True for both controls

    0 讨论(0)
提交回复
热议问题