简体   繁体   English

在弹出窗口中打印pdf并显示错误“找不到成员”

[英]print pdf in popup and get error “Member Not Found”

I use to print pdf in popup and get error "Member Not Found". 我用来在弹出窗口中打印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# code is: C#代码是:

string saveCaseScript = string.Empty;
    saveCaseScript = (Above Script are here);
    ClientScript.RegisterStartupScript(this.GetType(), "rpt", saveCaseScript);

thanks 谢谢

Here I close the popup window befor open new one. 在这里,我关闭打开新窗口之前的弹出窗口。 I use this scenario untill the next solution i find. 我用这种情况直到找到下一个解决方案。 hope may be you have the same problem. 希望您可能遇到同样的问题。

var CD; //Open Report. 
    function openNewWin(url) {
      try {
        CD = window.open(url, "Popup", 'width=800,height=600,toolbar=yes,status=yes,scrollbars=yes,resizable=yes,menubar=yes,location=no');
        CD.focus();
      }
      catch (e) {
        CD.close();
        CD = window.open(url, "Popup", 'width=800,height=600,toolbar=yes,status=yes,scrollbars=yes,resizable=yes,menubar=yes,location=no');
        CD.focus();
      }
    } 

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

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