hi
i have a user control below like :
<script> function CallButtonClick2() { document.getElementById('Button2').click(); }</script><a onclick="CallButtonClick2()" href="javascript:void('0');">Call Server Function</a><asp:Button ID="Button2" runat="server" Text="Call Button Click" OnClick="Button2_Click" />
and in aspx page use this code :
<form id="form1" runat="server"> <div> <asp:ScriptManager ID="scriptMgr" runat="server" /> <asp:UpdatePanel ID="updatePnl" runat="server" UpdateMode="Always"> <ContentTemplate> <br /> <asp:Button ID="btnViewReport" runat="server" OnClick="btnViewReport_Click" Text="????? ?????" Width="100px" Height="20px" CssClass="Button non-print " /> <br /> <div style="height: 35px; padding-top: 5px; padding-bottom: 5px"> <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="updatePnl" DisplayAfter="100" DynamicLayout="true"> <ProgressTemplate> <center> loding.... </center> </ProgressTemplate> </asp:UpdateProgress> </div> <div id="fieldSetReport" runat="server"> <table width="100%"> <tr> <td> <asp:PlaceHolder runat="server" ID="plc" /> </td> </tr> </table> </div> </ContentTemplate> </asp:UpdatePanel> </div> </form>in code behind : protected void btnViewReport_Click(object sender, EventArgs e) { Control myControl = new Control(); myControl = LoadControl("WebUserControl.ascx"); this.plc.Controls.Add(myControl); }
but when click on <a onclick="CallButtonClick2()" href="javascript:void('0');">Call Server Function</a>
don't runt then event
please help me how to run the event user control when add dynamic
thanks