繁体   English   中英

在Response.Redirect中添加新窗口属性

[英]Adding new window Properties in Response.Redirect

我在Response.Redirect的帮助下将以下用于重定向到另一个页面的javascript代码转换为c#代码(服务器端)

javascript是这个。

function GetBillDetails() {
    var childWindow = null;
    var SelVal = ddl.options[ddl.selectedIndex].value;
    var SelText = ddl.options[ddl.selectedIndex].text;
    childWindow = window.open('../Mine/MyPrint.aspx?BillNo=' + SelVal + '&Bill=' + SelText +, "MainForm", "width=725px,height=530px,left=150px,top=50px,scrollbars=no,toolbars=no,resizable=no")
}

和带有Response.Redirect的C#代码是,

string BillNo = "255", Bill = "CG2/78";
Response.Redirect("../Mine/MyPrint.aspx?BillNo=" + BillNo + "&Bill='" + Bill + ");

工作正常。 但是我的问题是如何在JavaScript代码中使用Response.Redirect添加这些新的窗口属性

"width=725px,height=530px,left=150px,top=50px,scrollbars=no,toolbars=no,resizable=no"

代替response.redirect,请尝试以下操作:

Response.write("<script>");
Response.write("window.open('YOUR_PAGE_WITH_PARAM','_blank')");
Response.write("</script>");

要么

Response.Write("<script language='javascript'> window.open('YOUR_PAGE_WITH_PARAM', 'window','HEIGHT=600,WIDTH=820,top=50,left=50,toolbar=yes,scrollbars=yes,resizable=yes');</script>");

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM