开发者

Button onClick event not firing inside a repeater which is in UpdatePanel

I know I am missing something simple but I can't seem to get my button to post back. This is how my form looks (simplified):

<asp:ScriptManager id="smMembersArea" runat="server" EnableViewState="False" />
<asp:UpdatePanel id="updAccounts" runat="server" EnableViewState="True">
  <ContentTemplate>
    <asp:Repeater id="rptrWishList" runat="server" EnableViewState="False">
      <HeaderTemplate></HeaderTemplate>
        <ItemTemplate>
          <asp:Button id="bWLAmend" onclick="FEdit" runat="server" cssclass="button bg" EnableViewState="True" Text="GO"/>
        </ItemTemplate>
      <FooterTemplate></FooterTemplate>
    </asp:Repeater>
  </ContentTemplate>
</asp:UpdatePanel开发者_JS百科>

The update panel doesn't do anything and nothing happens in FEdit.

When I remove the updatepanel my FEdit event is triggered correctly.

Can anyone point me in the right direction please.

Thanks.


what you can do is add CommandName="Select" to your button

so your button now looks like this

<asp:Button id="bWLAmend" onclick="FEdit" runat="server" cssclass="button bg" EnableViewState="True" Text="GO" CommandName="Select"/>

and use itemcommand of the repeater rptrWishList_ItemCommand

so when you click the button, itemcommand event of repeater fires.

what language you are using in code behind..?I may be able to suggest something else.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜