【发布时间】:2014-01-30 10:26:45
【问题描述】:
我是 asp.net 的新手, 我有一个包含复选框的转发器,每当我选中复选框时,我都会在 checkchanged 上触发一个事件,但页面回发。 我的页面中的全部内容都有一个更新面板,但仍然会发生回发。无论如何要避免回发。 (Ps:为了避免Postback,我的意思是避免出现的闪烁)
谢谢
<asp:Repeater ID="rptrDepartment" runat="server" OnItemCommand="rptrDepartment_ItemCommand"
OnItemDataBound="rptrdepartment_databound">
<ItemTemplate>
<tr>
<td>
<asp:CheckBox ID ="chkRow" runat="server" OnCheckedChanged="ChkRow_ChkChanged" AutoPostback="true" />
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
在我的 .cs 页面中,
protected void ChkRow_ChkChanged(object sender, EventArgs e)
{
//some method
}
【问题讨论】:
-
更新面板和更新模式的触发器是什么?请添加您的代码
-
更新模式设置为默认,我没有触发它。