ASP.NET CheckBox does not fire CheckedChanged event when unchecking

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

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



        
9条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-08 10:53

    I'm not sure but I guess that my solution is working only for .NET Framework 4.0:

    Use ViewStateMode = "Disabled" to disable view state insted of EnableViewState="false". This will caution the same behavior except that you can save a local view state.

    So, on your checkbox, set the attribute ViewStateMode = "Enabled" and the problem is solved, without implementing a custom checkbox.

提交回复
热议问题