ASP.NET CheckBox does not fire CheckedChanged event when unchecking

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

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



        
9条回答
  •  旧巷少年郎
    2020-12-08 10:46

    It doesn't fire because with viewstate disabled the server code does not know that the checkbox was previously checked, therefore it doesn't know the state changed. As far as asp.net knows the checkbox control was unchecked before the postback and is still unchecked. This also explains the reverse behavior you see when setting Checked="true".

提交回复
热议问题