R
Robir
I'm implementing a DataList that includes textboxes and check boxes in a
table in the ItemTemplate.
The following line in the HTML results in the error
[System.InvalidCastException: Specified cast is not valid] when I go to run
the project.
<td><asp:CheckBox id="chkIncluded" runat="server" Checked=<%#
DataBinder.Eval(Container.DataItem, "Included") %>></asp:CheckBox></td>
I have tried a couple variations of the Boolean true value in the DataSet
(including "true", -1, 1) to which the code is binding, and nothing seems to
help.
FWIW, The following line works fine for textbox controls (so I know I have
the right syntax for something - just not checkBoxes).
<td><asp:Label id="lblActiveStatus" Width="70px" runat="server"> <%#
DataBinder.Eval(Container.DataItem, "Active") %> </asp:Label></td>
TIA
table in the ItemTemplate.
The following line in the HTML results in the error
[System.InvalidCastException: Specified cast is not valid] when I go to run
the project.
<td><asp:CheckBox id="chkIncluded" runat="server" Checked=<%#
DataBinder.Eval(Container.DataItem, "Included") %>></asp:CheckBox></td>
I have tried a couple variations of the Boolean true value in the DataSet
(including "true", -1, 1) to which the code is binding, and nothing seems to
help.
FWIW, The following line works fine for textbox controls (so I know I have
the right syntax for something - just not checkBoxes).
<td><asp:Label id="lblActiveStatus" Width="70px" runat="server"> <%#
DataBinder.Eval(Container.DataItem, "Active") %> </asp:Label></td>
TIA