listview嵌套UpdatePanel 不刷新求助
<asp:ListViewID="ListView_tj"runat="server"><LayoutTemplate><divrunat="server"id="ite...
<asp:ListView ID="ListView_tj" runat="server">
<LayoutTemplate>
<div runat="server" id="itemPlaceholder">
</div>
</LayoutTemplate>
<ItemTemplate>
<div>
<div>
<asp:Label ID="Label_Class" runat="server" Text="标题"></asp:Label>
</div>
<div>
<asp:UpdatePanel ID="UpdatePanel_read" ChildrenAsTriggers="false" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Label ID="Label_Overview" runat="server" Text="简短内容"></asp:Label>
<asp:Label ID="Label_Read" Visible="false" runat="server" Text="全部内容"></asp:Label>
</ContentTemplate>
<Triggers><asp:AsyncPostBackTrigger ControlID="LinkButton_Read" /></Triggers>
</asp:UpdatePanel></div>
<div>
<asp:LinkButton ID="LinkButton_Read" onclick="LinkButton_Read_Click" runat="server" CausesValidation="False">阅读全文</asp:LinkButton>
<asp:LinkButton ID="LinkButton_hidden" runat="server">收起</asp:LinkButton></div>
</div>
</ItemTemplate>
</asp:ListView>
C#
protected void LinkButton_Read_Click(object sender, EventArgs e)
{
Label lo = (Label)this.ListView_tj.FindControl("Label_Overview");
lo.Visible = false;
//this.Label_Read.Visible = true;
}
==============================
我在listview里每项都绑定一个UpdatePanel,想点击阅读全文 然后实现一个label隐藏一个label显示
,但页面能正常显示,点击按钮却没反应
我ajax就会用个UpdatePanel,请大家帮忙解决一下,顺便知道原因的告诉我一下,为么不刷新,先谢谢了 展开
<LayoutTemplate>
<div runat="server" id="itemPlaceholder">
</div>
</LayoutTemplate>
<ItemTemplate>
<div>
<div>
<asp:Label ID="Label_Class" runat="server" Text="标题"></asp:Label>
</div>
<div>
<asp:UpdatePanel ID="UpdatePanel_read" ChildrenAsTriggers="false" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Label ID="Label_Overview" runat="server" Text="简短内容"></asp:Label>
<asp:Label ID="Label_Read" Visible="false" runat="server" Text="全部内容"></asp:Label>
</ContentTemplate>
<Triggers><asp:AsyncPostBackTrigger ControlID="LinkButton_Read" /></Triggers>
</asp:UpdatePanel></div>
<div>
<asp:LinkButton ID="LinkButton_Read" onclick="LinkButton_Read_Click" runat="server" CausesValidation="False">阅读全文</asp:LinkButton>
<asp:LinkButton ID="LinkButton_hidden" runat="server">收起</asp:LinkButton></div>
</div>
</ItemTemplate>
</asp:ListView>
C#
protected void LinkButton_Read_Click(object sender, EventArgs e)
{
Label lo = (Label)this.ListView_tj.FindControl("Label_Overview");
lo.Visible = false;
//this.Label_Read.Visible = true;
}
==============================
我在listview里每项都绑定一个UpdatePanel,想点击阅读全文 然后实现一个label隐藏一个label显示
,但页面能正常显示,点击按钮却没反应
我ajax就会用个UpdatePanel,请大家帮忙解决一下,顺便知道原因的告诉我一下,为么不刷新,先谢谢了 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询