ボタン クリック イベントの最後に、RegisterStartupScript を使用して新しい Windows を開くコードがあります (ユーザーが印刷するレポートです)。
ページが読み込まれた後、ユーザーをデータ入力ページからデフォルトのページにResponse.Redirect
リダイレクトしたいと思いますが、それを入れてもポップアップ ウィンドウが開きません。ポップアップが起動しない理由は何ですか?
これはc#コードです:
string myRptURL = "EstimateReport.aspx?id=" + hiddenID.Value;
string script = "window.open('" + myRptURL + "','')";
ClientScript.RegisterStartupScript(this.GetType(), "OpenWin", "<script>openNewWin('" + myRptURL + "')</script>");
Response.Redirect("default.aspx?mess=" + Server.UrlEncode("New Estimate Created"));
これはJavascript関数です:
<script language="javascript" type="text/javascript">
function openNewWin(url) {
var x = window.open(url, 'mynewwin', '_blank', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=600,height=520,modal=yes,alwaysRaised=yes');
x.focus();
}