TimeIsNear TimeIsNear - 26 days ago 9
ASP.NET (C#) Question

Why new window is opening when Click submit button in popup?

Hi I Opening a popup like this:

function openPopup() {
RetVal = window.showModalDialog("chooseProducts.aspx", "", "dialogHeight: 330px; dialogWidth: 450px;scroll:no");
}


In the popup, when I click this button a new window is opening (with the popup contain):

<asp:Button ID="btnSave" runat="server" Text="Save" OnClick="savingImpr" OnClientClick="window.close();"/>


I try to close the current popup before this new window. But this new window is display.
Could you help me, thank you!

EDIT

I've try to return false after the widow.close in popup, ok new window is not fired, but Onclick event not call.

<asp:Button ID="btnSave" runat="server" Text="Save" OnClick="savingImpr" OnClientClick="window.close();return false;"/>


have you a suggestion?

Answer

can you try window.open(....) ?

Edit on opening parent window, set this class to your parent window, so that it will be like modalpopup behaviour

 .Background
    {
        position: relative;
        width: 100%;
        height: 100%;
        filter: alpha(opacity=40);
    }

change class $get('dvMain').className = 'Background';