ASP.NET CheckBox does not fire CheckedChanged event when unchecking

前端 未结 9 718
隐瞒了意图╮
隐瞒了意图╮ 2020-12-08 10:04

I have a CheckBox on an ASP.NET Content Form like so:



        
9条回答
  •  爱一瞬间的悲伤
    2020-12-08 10:39

    I had the same problem. I have spent a lot of time on it and finally have solved it.

    In my case the Checkbox was disabled by default:

    
    

    It turns ViewState isn't loaded for disabled or invisible controls. So remove Enabled="false" or Visible="false" and it will work as expeceted. And of course ViewState shouldn't be disabled.

提交回复
热议问题