在javascript中从Hosted网站重定向到本地IIS服务器页面

时间:2013-12-19 11:27:05

标签: c# javascript asp.net .net iis

我有一个托管在本地IIS计算机(工作PC)中的Web应用程序,以及托管在服务器中的应用程序。在我无法打印报告的情况下,我需要将值传递到本地IIS计算机中的页面并打开我能够打印报告的页面。

这可能吗?

如果是,该怎么做?

我尝试使用本地IP进行重定向,但这不起作用。

//代码

 <script language="javascript" type="text/javascript">
     function OpenPopupCenter(pageURL, title, w, h) {
         var left = (screen.width - w) / 2;
         var top = (screen.height - h) / 4;  // for 25% - divide by 4  |  for 33% - divide by 3
         var targetWin = window.open("Report.aspx?Invoiceno=5555", "Print", 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left);
     } 
    </script>

在上面的代码中,Report.aspx页面位于本地IIS服务器中。

1 个答案:

答案 0 :(得分:0)

扩展我的评论,您想使用http://localhost所以:

<script language="javascript" type="text/javascript">
   function OpenPopupCenter(pageURL, title, w, h) {
       var left = (screen.width - w) / 2;
       var top = (screen.height - h) / 4;  // for 25% - divide by 4  |  for 33% - divide by 3
       var targetWin = window.open("http://localhost/Report.aspx?Invoiceno=5555", "Print", 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left);
 } 
</script>