これは私の前の質問に続いています.ポップアップウィンドウを閉じるときに親ページをリロードする方法は?
私は物事の組み合わせを試みましたが、それを機能させることができませんでした。"yes" 、 "no" または x(to close) 、場合によっては..次のコードの場合のように..どのオプションをクリックしてもコードビハインドが実行されない..
<asp:Button ID="btnAccept" runat="server" Text="Accept" OnClientClick="return Refresh()" style="HEIGHT: 19px;background: #C0003B;color: white; " /> <asp:Button ID="btnReject" runat="server" Text="Reject" OnClientClick="Refresh()" style="HEIGHT: 19px;background: #C0003B;color: white;"/>
</div>
<script type="text/javascript">
function Refresh() {
var myBoolean = new Boolean();
myBoolean = confirm('Are you sure?');
if (myBoolean) {
window.onunload = refreshParent;
function refreshParent() {
window.opener.location.reload();
return true;
}
}
else {return false;}
}
</script>