I have a LinkButton in a ListView in an UpdatePanel. I would like the button (well, any of them) to cause a partial postback, but they are causing a full page postback.
<asp:UpdatePanel ID="upOutcomes" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<asp:ListView ID="lvTargets" runat="server" onitemdatabound="lvTargets_ItemDataBound">
<ItemTemplate>
<asp:LinkButton ID="lnkAddTarget" CssClass="lo" Text='<%# Eval("Title") + " <b>" + Eval("Level") + Eval("SubLevel") + "</b>" %>' runat="server"></asp:LinkButton>
</ItemTemplate>
</asp:ListView>
</ContentTemplate>
</asp:UpdatePanel>
I found another post on stackoverflow which suggested adding this:
protected void lvTargets_ItemDataBound(object sender, ListViewItemEventArgs e) {
var lb = e.Item.FindControl("lnkAddTarget") as LinkButton;
tsm.RegisterAsyncPostBackControl(lb); // ToolkitScriptManager
}
It hasn't made a difference...
There are a few other similar posts too, but I can't find a solution! Any ideas?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…