asp:CheckBox two-way binding problem
-
Hi I have a problem with binding parameters to an update command for an asp:SqlDataSource. The problem is when I am trying to bind a ASP:CheckBox field. I have this definition …………….
--------- I am getting this error; Cannot insert the value NULL into column 'PrivateLivingArea', table 'RentalProperty.dbo.HomeListing'; column does not allow nulls. UPDATE fails. The statement has been terminated. I know what it means but I can not figure out how to bind this checkbox field to the query parameters
-
Hi I have a problem with binding parameters to an update command for an asp:SqlDataSource. The problem is when I am trying to bind a ASP:CheckBox field. I have this definition …………….
--------- I am getting this error; Cannot insert the value NULL into column 'PrivateLivingArea', table 'RentalProperty.dbo.HomeListing'; column does not allow nulls. UPDATE fails. The statement has been terminated. I know what it means but I can not figure out how to bind this checkbox field to the query parameters
Hi there, The
Eval
method supports one-way (read-only) binding, here there are two options: + You can use theBind
method which supports two-way databinding instead of theEval
, you can read more about this in MSDN[^]. + You can create a handler for theUpdating
event of the SqlDataSource control, in the method you can query the value of the check box and pass it to the input paramaters of the command.