开发者

linkbutton doesn't work for updatepanel

I have set of link buttons outside update panel but when click any one of them they donot work at all , when i set the postbackUrl they make full postback

my source code:

<asp:Panel ID="pnl_viewImages" runat="server">

<asp:Label ID="lbl_viewImages" runat="server" style="texalign: left" 
    Text="view images :"></asp:Label>
<br />
<br />
<br />

<table cellpadding="0" cellspacing="0" style="width: 100%" class ="Alternating">
    <tr>
        <td colspan="5">

            <asp:UpdatePanel ID="updatePnl_image" runat="server">
                <ContentTemplate>
                    <asp:ListView ID="lv_showImages" runat="server">
                        <ItemTemplate>
                            <asp:Image ID="img_showNewsImage0" runat="server" Height="300px" 
                                ImageUrl='<%# "RetreiveImage.ashx" %>' Width="413px" />
                        </ItemTemplate>
                    </asp:ListView>
                </ContentTemplate>
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="lbtn_first" EventName="Click" />
                    <asp:AsyncPostBackTrigger ControlID="lbtn_last" EventName="Click" />
                    <asp:AsyncPostBackTrigger ControlID="lbtn_next" EventName="Click" />
                    <asp:AsyncPostBackTrigger ControlID="lbtn_previous" EventName="Click" />
                    <asp:AsyncPostBackTrigger ControlID="lbtn_delete" EventName="Click" />
                </Triggers>
            </asp:UpdatePanel>

        </td>
    </tr>
    <tr>
        <td>
            <asp:LinkButton ID="lbtn_first" runat="server" onclick="lbtn_first_Click">first</asp:LinkButton>
        </td>
        <td>
          开发者_运维技巧  <asp:LinkButton ID="lbtn_previous" runat="server" onclick="lbtn_first_Click">&lt;&lt;</asp:LinkButton>
        </td>
        <td>
            <asp:LinkButton ID="lbtn_next" runat="server" onclick="lbtn_first_Click" 
                >&gt;&gt;</asp:LinkButton>
        </td>
        <td>
            <asp:LinkButton ID="lbtn_last" runat="server" onclick="lbtn_first_Click">last</asp:LinkButton>
        </td>
        <td>
            <asp:LinkButton ID="lbtn_delete" runat="server" onclick="lbtn_first_Click">delete</asp:LinkButton>
        </td>
    </tr>
</table>
<br />

i tried to remove the table but in vain it does not work also.


You need to put the LinkButtons in the UpdatePanel or put them in their own UpdatePanel.


You appear to be missing a ScriptManger defined before your update panel such as

<asp:ScriptManager ID="ScriptManager1" runat ="server"></asp:ScriptManager>

I think that is probably causing your problem.

Controls outside of the panel can invoke a partial postback.

Paul

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜