G
Guest
Hi,
I have a check box in a column of my DataGrid. This DataGrid lists all the
users of my site and the CheckBox basically is for me to toggle between
disabling or enabling a user.
This is the code for the CheckBox.
<asp:TemplateColumn>
<ItemTemplate>
<asp:CheckBox id="ChkBoxDisable" runat="server" Checked='<%#
DataBinder.Eval(Container.DataItem, "disable") %>' AutoPostBack="True"
OnCheckedChanged='DisableClicked(<%# DataBinder.Eval(Container.DataItem,
"userID") + "," + DataBinder.Eval(Container.DataItem, "disable") %>)' />
</ItemTemplate>
</asp:TemplateColumn>
I wanted it to call the method DisableClicked(int userID, int currentStatus)
when it's clicked. However, it's giving me a compiler error:
CS1040: Preprocessor directives must appear as the first non-whitespace
character on a line
What's wrong?
Thanks.
I have a check box in a column of my DataGrid. This DataGrid lists all the
users of my site and the CheckBox basically is for me to toggle between
disabling or enabling a user.
This is the code for the CheckBox.
<asp:TemplateColumn>
<ItemTemplate>
<asp:CheckBox id="ChkBoxDisable" runat="server" Checked='<%#
DataBinder.Eval(Container.DataItem, "disable") %>' AutoPostBack="True"
OnCheckedChanged='DisableClicked(<%# DataBinder.Eval(Container.DataItem,
"userID") + "," + DataBinder.Eval(Container.DataItem, "disable") %>)' />
</ItemTemplate>
</asp:TemplateColumn>
I wanted it to call the method DisableClicked(int userID, int currentStatus)
when it's clicked. However, it's giving me a compiler error:
CS1040: Preprocessor directives must appear as the first non-whitespace
character on a line
What's wrong?
Thanks.