【发布时间】:2009-07-26 21:29:04
【问题描述】:
我有两个更新面板,第一个更新面板 (up1) 包含一个重复器控件,它只是重复一个按钮控件。当在 up1 中单击其中一个按钮时,我只想使用从 up1 中的按钮传递的参数来更新第二个更新面板(up2)。 基本上,每个按钮都有一个对话 ID,因此当单击 up2 时,将从具有该 ID 的对话中获取所有消息。由于其他功能,需要有两个更新面板。
<asp:ScriptManager ID="ScriptManager1" EnablePageMethods="true" EnablePartialRendering="true" runat="server" >
</asp:ScriptManager>
<asp:UpdatePanel runat="server" ID="up1" OnLoad="up1_Load">
<ContentTemplate>
<asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate>
<asp:Button ID="Button1" runat="server"
CommandName="conversationID"
CommandArgument='<%# Eval("conversation_id") %>' />
</ItemTemplate>
</asp:Repeater>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="up2" runat="server">
<ContentTemplate>
<asp:Repeater ID="Repeater2" runat="server">
<ItemTemplate>
<p><%#Eval("message")%></p>
</ItemTemplate>
</asp:Repeater>
</ContentTemplate>
</asp:UpdatePanel>
我尝试在后面的代码中传递命令参数,但它不起作用!请有人能指出我正确的方向吗?
非常感谢
【问题讨论】:
标签: asp.net ajax updatepanel