I have a ModalPopupExtender extending a panel and in the panel, there is a function i want to perform which is executed with a button within the panel and after it executes, it will close the panel.
However,btnProcess when click is not firing btnProcess_Click at all.. debugging shows that the function is not executed at all
I am clueless of why it’s not firing.
<asp:Panel ID="Panel1" runat="server" Height="600px" Width="800px" CssClass="ModalWindow">
<asp:Button ID="btnProcess" runat="server" Text="Ok" onclick="btnProcess_Click"/>
</asp:Panel>
<ajaxToolkit:RoundedCornersExtender ID="Panel1_RoundedCornersExtender" runat="server"
Enabled="True" TargetControlID="Panel1" Radius="10" BorderColor="Black">
</ajaxToolkit:RoundedCornersExtender>
<ajaxToolkit:ModalPopupExtender ID="Panel1_ModalPopupExtender" runat="server" DynamicServicePath=""
BackgroundCssClass="modalBackground" Enabled="True" PopupControlID="Panel1" TargetControlID="dummy" >
</ajaxToolkit:ModalPopupExtender>
this is the code it supposed to run.
protected void btnProcess_Click(object sender, EventArgs e)
{
//process .. bla bla bla
Panel1_ModalPopupExtender.hide();
}
I had the same problem and I solved it by add this line to your code behind:
and this in your markup :