Receive boolean value via Avascript in a popup to be used on another page

Asked

Viewed 61 times

-1

I have a page that opens a confirmation popup, the popup is called with the window.showModalDialog, I need to take true or false of this popup, to work on page 1 where the returned value will be used, but I’m not getting, I was told to use the window.open instead of window.showModalDialog, it even opens the popup but does not return the value, but it does not work, I am using VB.Net

//Pagina 1
var Retorno = window.showModalDialog("../Popup/FramePop.aspx?Pagina=PopConfirmacao.aspx")

document.getElementById('idAquiDoElemento').value = Retorno;

//javaScript do botão confirmar no popUp aberto em outra página aspx

function ConfirmarDados(acao, document)
{

            window.returnValue = acao;

}

1 answer

0

I already did, I passed a function Avascript via url when opening the popup, and then in the popup function I was able to access and work the value on it.

//Page 1

Function Fnactualizes(return) { Document.getElementById('idAquiDoElemento'). value = return;

        return retorno;
    }

var Return = window.showModalDialog(".. /Popup/Framepop.aspx? Page=Popconfirmation.aspx", { confirmaContactCallback: Fnupdates})

Document.getElementById('idAquiDoElemento'). value = Return;

//Confirm button on the popup opened in another aspx page

Function Confirm data(action) {

       var dialogArguments = window.dialogArguments;
        dialogArguments.confirmaContatoCallback(acao);
        window.close();

}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.