2015-05-29 63 views
1

我有一个使用嵌套的子元素在updatepanel中的asp.net linkbutton的问题。asp.net linkbutton不会在updatepanel中触发嵌套的孩子

当我使用的UpdatePanel一个LinkBut​​ton,onclick事件是由Ajax请求正常工作:

<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> 

所以,当我里面插入的LinkBut​​ton一个html的孩子,然后Ajax请求不点火,做它作为一个回传请求:

<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> 

任何机构可以帮助我解决这个问题在updatepanel?

回答

1

这个问题,通过这个固定的变化web.config文件:

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