我用来在弹出窗口中打印 pdf 并收到错误“未找到成员”。
<script >
var url;
url = 'test.aspx?SID=" + ID + "&Val=" + 2 + "&Loc=" + US + "';
var SaveCaseBrowser;
SaveCaseBrowser=window.open(url ,'Rpt','width=800,height=600,toolbar=yes,status=yes,scrollbars=yes,resizable=yes,menubar=yes,location=no');
if((SaveCaseBrowser == null)||(typeof(SaveCaseBrowser)== 'undefined'))
{alert('An error occurred trying to launch a new window.');
}
else
{
try
{
setTimeout(function () { SaveCaseBrowser.focus(); }, 100); } catch(e) { SaveCaseBrowser.Close(); SaveCaseBrowser=window.open(url ,'Rpt','width=800,height=600,toolbar=yes,status=yes,scrollbars=yes,resizable=yes,menubar=yes,location=no'); }}</script>")
c#代码是:
string saveCaseScript = string.Empty;
saveCaseScript = (Above Script are here);
ClientScript.RegisterStartupScript(this.GetType(), "rpt", saveCaseScript);
谢谢