如何仅在更改检查时更新面板?

时间:2015-05-28 00:49:47

标签: c# updatepanel

<asp:UpdatePanel id="up1" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true">

<ContentTemplate>

<asp:CheckBox ID="chkParent" runat="server" autopostback="true" OnCheckedChanged="chkParent_OnCheckedChanged" />

<asp:DataList ID="ChildList" runat="server" OnItemDataBound="ChildList_OnItemDataBound">

 </ContentTemplate>
</asp:UpdatePanel>

protected void chkParent_OnCheckedChanged(object sender, EventArgs e)
{
 this.ChildList.DataSource = this.ChildValues;
this.ChildList.DataBind();
}

在检查更改了父级时,子级会更新,但整个页面也会加载。有什么方法可以避免它吗?

0 个答案:

没有答案