使用显示列表的转发器,其中包含复选框字段。 当单击一个复选框时,我希望该函数运行并显示标签....试图调试这个但似乎无法启用它,使用断点不会拿起函数
//代码隐藏
protected void chkMyCheck_CheckedChanged(object sender, EventArgs e)
{
label.Text = "Button Clicked";
}
ASPX:
<asp:Repeater id="rptSelectedUtilities" runat="server">
<HeaderTemplate>
<table class="detailstable FadeOutOnEdit">
<tr>
<th style="width:200px;">Utility</th>
<th style="width:200px;">Contacted</th>
<th style="width:200px;">Comment</th>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<th style="width:200px;"><%# Eval("Name") %></th>
<th style="width:200px;"><asp:CheckBox ID="chkMyCheck" AutoPostBack="true" runat="server" OnCheckedChanged="chkMyCheck_CheckedChanged" Checked='<%# Convert.ToBoolean(Eval("Checked")) %>'/></th>
<th style="width:200px;"><%# Eval("Comment") %></th>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
<asp:Label id="labelTableEmpty" runat="server" Text="There are currently no items in this table." />
<asp:Label ID ="label" runat="server" />
当点击一个复选框时,为什么代码没有进入chkMyCheck_CheckedChanged函数的任何想法?,页面重新刷新,以便自动回发
答案 0 :(得分:1)