Radiobutton checkchanged事件未正确触发 [英] Radiobutton checkchanged event not firing properly

查看:120
本文介绍了Radiobutton checkchanged事件未正确触发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<asp:RadioButton ID="rdb_previous_post_holder_yes" runat="server"
                                       GroupName="Previous post holder" Text="Yes" AutoPostBack="True"
                                       OnCheckedChanged="rdb_previous_post_holder_yes_CheckedChanged" CssClass="label" Visible="False" />










protected void rdb_previous_post_holder_yes_CheckedChanged(object sender, EventArgs e)
  {
      if (rdb_previous_post_holder_yes.Checked == true)
      {         
          pnl_current_post_holder.Visible = true;         

      }
      else
      {
          pnl_current_post_holder.Visible = false;
      }
  }





我有两个单选按钮是&不。当我点击是时,它应该执行下面的代码,当没有选择时,它应该执行相反的操作。

它工作正常,checkchanged事件在前几次点击时触发,但在测试期间,当用户点击两次或三次以上时,checkchanged事件未触发。



请让我知道应该怎么做才能纠正它?



I have two radio buttons yes & No. When I click Yes it should do the code below and when No selected it should do the opposite .
It works fine and the checkchanged event is firing for the first few clicks but during testing when the user clicks more than two or three times the checkchanged event is not firing.

Please let me know what should do to rectify it?

推荐答案

设置radiobutton属性'AutoPostback = true'默认为false
set the radiobutton property 'AutoPostback=true' default it is false


这篇关于Radiobutton checkchanged事件未正确触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆