首页 新闻 会员 周边 捐助

在webform中 checkbox控件不起作用

0
[已解决问题] 解决于 2022-12-08 12:37

有一段代码:

<td valign="top" align="right">
<asp:DataGrid ID="dgPendingApplications" runat="server" Width="800px" AllowSorting="True" AutoGenerateColumns="False" OnSelectedIndexChanged="dgPendingApplications_SelectedIndexChanged">
<SelectedItemStyle BackColor="LawnGreen"></SelectedItemStyle>
<AlternatingItemStyle BackColor="#FBFAE6"></AlternatingItemStyle>
<HeaderStyle Wrap="true" HorizontalAlign="Center" CssClass="lbl_bold" BackColor="#CCCC00"></HeaderStyle>
<Columns>
asp:TemplateColumn
<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
<ItemTemplate>
<asp:CheckBox ID="chkbox" runat="server"></asp:CheckBox>
</ItemTemplate>
</asp:TemplateColumn>
<asp:BoundColumn DataField="name_primaryinsured" SortExpression="name_primaryinsured" ReadOnly="True" HeaderText="Primary Insured">
<HeaderStyle HorizontalAlign="Left"></HeaderStyle>
<ItemStyle HorizontalAlign="Left" CssClass="cell_normal"></ItemStyle>
</asp:BoundColumn>
<asp:BoundColumn DataField="applicationNO" SortExpression="applicationNO" HeaderText="Application No" ReadOnly="True">
<HeaderStyle HorizontalAlign="Left"></HeaderStyle>
<ItemStyle HorizontalAlign="Left" CssClass="cell_normal"></ItemStyle>
</asp:BoundColumn>
<asp:BoundColumn DataField="crdate" SortExpression="crdate" ReadOnly="True" HeaderText="Date Created" DataFormatString="{0:MM/dd/yyyy}">
<HeaderStyle HorizontalAlign="Left"></HeaderStyle>
<ItemStyle HorizontalAlign="Left" CssClass="cell_normal"></ItemStyle>
</asp:BoundColumn>
<asp:BoundColumn DataField="address" SortExpression="address" ReadOnly="True" HeaderText="Property Location">
<HeaderStyle HorizontalAlign="Left"></HeaderStyle>
<ItemStyle HorizontalAlign="Left" CssClass="cell_normal"></ItemStyle>
</asp:BoundColumn>
<asp:BoundColumn DataField="StatusCode" SortExpression="StatusCode" ReadOnly="True" HeaderText="Status">
<HeaderStyle HorizontalAlign="Left"></HeaderStyle>
<ItemStyle HorizontalAlign="Left" CssClass="cell_normal"></ItemStyle>
</asp:BoundColumn>
asp:TemplateColumn
<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
<HeaderTemplate>
</HeaderTemplate>
<ItemTemplate>
<asp:LinkButton ID="lnkbSelect" CssClass="body" runat="server" CommandName='<%# DataBinder.Eval(Container.DataItem, "StatusCode") %>' CommandArgument='<%# DataBinder.Eval(Container.DataItem, "InsfrontFpApplication") %>' title='<%# DataBinder.Eval(Container.DataItem, "InsfrontFpApplication") %>'>EDIT</asp:LinkButton>
</ItemTemplate>
</asp:TemplateColumn>
asp:TemplateColumn
<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
<HeaderTemplate>
</HeaderTemplate>
<ItemTemplate>
<asp:LinkButton ID="lnkbCopy" CssClass="body" runat="server">Copy</asp:LinkButton>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid></td>

但是 <asp:CheckBox ID="chkbox" runat="server"></asp:CheckBox> 没起作用:

请问是什么原因?

泰德的主页 泰德 | 初学一级 | 园豆:6
提问于:2022-11-04 02:53
< >
分享
最佳答案
0

解决了,后端控制。

泰德 | 初学一级 |园豆:6 | 2022-12-08 03:38
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册