Search code examples
asp.netajaxupdatepanellinkbutton

asp.net linkbutton does not fire with nested childs in updatepanel


i have a problem with nested child element in use asp.net linkbutton within updatepanel.

when i use a linkbutton in updatepanel, onclick event is works fine by ajax request:

<asp:updatepanel runat="server" childrenastriggers="true">
<contenttemplate>
    <asp:repeater runat="server" id="myrpt">
        <itemtemplate>
            <asp:linkbutton runat="server">click me</asp:linkbutton>
        </itemtemplate>
    </asp:repeater>
</contenttemplate>
</asp:updatepanel>

so, when i insert a html child inside linkbutton, then ajax request not firing and do it as a postback request:

<asp:updatepanel runat="server" childrenastriggers="true">
<contenttemplate>
    <asp:repeater runat="server" id="myrpt">
        <itemtemplate>
            <asp:linkbutton runat="server"><i class="fa fa-times"></i></asp:linkbutton>
        </itemtemplate>
    </asp:repeater>
</contenttemplate>
</asp:updatepanel>

any body can help me to fix this problem in updatepanel?


Solution

  • this problem fixed by this changes in web.config file:

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
        <system.web>
            <pages clientIDMode="AutoID" />
        </system.web>
    </configuration>