I 've already opened the same question here
The problem is:
I have MainSite.aspx and the button btnOK that has btnOK_Click event. On the btnOK click event I want to open new web site (ConfirmationWindow.aspx) by passing a few input parameters from the main site. For example with one parameter:
this.btnOK.OnClientClick = "window.open('WindowConfir
r1=" + this.Variable1 + "')";
and btnOK_Click event which is called as
ConfirmationWindow.aspx contains gridview which will be bound with the stored procedures result according to the input parameters values from the MainSite.aspx and two buttons btnYES, and btnNO.
The question is, How can I get the response from the user click on btnYES or btnNO inside ConfirmationWindow.aspx back to my MainSite, and if the response is YES to finish MainSite-btnOK_Click . If response is NO then just close the ConfirmationWindow.aspx. And yes, after pressing one of the buttons either Yes or No, ConfirmationWindow.aspx should be automatically closed.
It would be nice to call return Java Script function which can return true if the user press btnYes, but question is how to do this ?
Also, is ti possible to prevent opening of more then one ConfirmationWindow.aspx. If user press once, ConfirmationWindow.aspx will open, but I want to prevent opening of the ConfirmationWindow.aspx again if it is already open.
I thinks that here is the main problem how to wait for the user response and then return true value which will in that case call the "btnOK_Click" event proc.
Many thanks !