I am trying to set the OnCheckedChanged event on a control in a ListView
template and I am getting the error "The server tag is not well formed" but
I cannot figure out why. The error is occurring on the line with the
checkbox control. Below is the ItemTemplate. Can anyone help? I am trying
to run a subroutine and send it a value from the TransID data item. Thanks.
David
<ItemTemplate>
<tr style="background-color:#DCDCDC;color: #000000;">
<td><asp:LinkButton ID="LBtnEdit" runat="server"
CommandName="Edit" Text="Edit"></asp:LinkButton></td>
<td><asp:CheckBox ID="ckPayTrans" runat="server"
Checked='<%# Eval("PayTrans") %>' AutoPostBack="True"
OnCheckedChanged="Check_Clicked(<%# Eval("TransID") %>)" /></td>
<td><asp:Label ID="LblTransDate" runat="server" Text='<%#
Eval("TransDate", "{0:d}") %>' /></td>
<td><asp:Label ID="LblClient" runat="server" Text='<%#
Eval("ClientLastFirst") %>' /></td>
<td><asp:Label ID="LblExpense" runat="server" Text='<%#
Eval("Expense") %>' />
<asp:Label ID="LblIncomeType" runat="server" Text='<%#
Eval("IncomeType") %>' CssClass="Hide" />
</td>
<td><asp:Label ID="LblVendorName" runat="server" Text='<%#
Eval("VendorName") %>' /></td>
<td align="right"><asp:Label ID="LblTransAmount"
runat="server" Text='<%# Eval("TransAmount", "{0:n2}") %>' /></td>
<td><asp:Label ID="LblAccountNo" runat="server" Text='<%#
Eval("AccountNo") %>' /></td>
<td><asp:Label ID="LblReferenceNo" runat="server" Text='<%#
Eval("ReferenceNo") %>' /></td>
<td><asp:LinkButton ID="LBtnDelete" runat="server"
CommandName="Delete" Text="Delete" CssClass="Hide"
OnClientClick="return confirmDel('Inc/Exp
Transaction');"></asp:LinkButton></td>
</tr>
</ItemTemplate>
3. Listviews, checkboxes and ItemActivate.OneClick
Like so many others I've been trying to make a listview with checkboxes that doesn't toggle the check state of an item when the item is selected. And then I found it: all you need to to is set the Activate property to ItemActivate.OneClick. Which isn't necessarily *entirely* obvious from the documentation: "The user must single-click to activate items. The cursor changes to a hand pointer cursor, and the item text changes color as the user moves the mouse pointer over the item." Can anyone give me any kind of logical explanation, no matter how twisted (non-twisted works too!), why OneClick causes the checkbox to behave the way I want? Thanks Johan
4. VGA and TreeView and ListView checkboxes are tiny
5. ListView: Checkboxes and an ImageList problem
Hi Peter Thank you for your help...
6. ListView + CheckBoxes: do not check if select?
Hi All, Instead of writing a custom control from the ground up, I would like to extend the ListView control to allow certain ListView items to contain a checkbox while others should not. Is this possible (ie. something that can be overridden)? Thanks, Rein