in web applicaiton,[asp.net] i am using modal popu control, it is working fine, but in modal popup close button [cancel button] event, i write a code for redirecting to another page but it is not reirecting [may be event is not firing], can you help me.
<asp:Panel ID ="slideshow1" runat ="server" >
<asp:GridView ID ="grd" runat ="server" ></asp:GridView>
<asp:Button ID ="btnClos" runat ="server" onclick="btnClos_Click" Text ="X close" />
</asp:Panel>
<asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID ="btn"
CancelControlID="btnClos" PopupControlID="slideshow1" BackgroundCssClass="modalBackground">
</asp:ModalPopupExtender>
<asp:Button ID ="btn" runat ="server" style="display:none;" />
I suspect that perhaps ModalPopupExtender is not propagating the submit of close button as it’s cancel button for the extender. There are couple of alternatives:
Instead of using it as
CancelControlIDargument, You can use java-script API for the ModalPopupExtender to hide it. For example,As you want to redirect to another page, the better alternative will be to simply redirect to different page rather than using server side redirect.