TimeIsNear TimeIsNear - 1 year ago 59
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!


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 Source

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

        position: relative;
        width: 100%;
        height: 100%;
        filter: alpha(opacity=40);

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download