mercredi 21 juin 2017

Converting to bool and using eval to give a checkbox checked giving a error

I've got this checkbox and I'm trying to eval a boolean value to it, I'm getting an error saying "Object cannot be cast from DBNull to other types. ". Here's my checkbox. Let me know if I should provide something else.

      <asp:CheckBox runat="server" ID="CurrSadlDepositClient" disabled="true" aria-describedby="lblSadlDepositClient" Checked='<%# Convert.ToBoolean(Eval("SadlDepositClient")) %>' />




Aucun commentaire:

Enregistrer un commentaire