zoukankan      html  css  js  c++  java
  • 模式对话框 打开文件

    第一步:我在页面A.asp 弹出模式对话框B.asp

      function Show() {           
       xposition = (screen.width - 800) / 2;
       yposition = (screen.height - 420) / 2;
       window.showModalDialog("B.aspx?Rnd=" + Math.random(), "LogDetail", "dialogHeight:550px; dialogWidth:670px;');window.location.href=window.location.href;");
       return false;
      }
    

    第二步:然后B.asp转到C.aspx服务器端按钮触发。

     Response.Redirect("C.aspx?rnd="+Guid.NewGuid());

    然后在C.aspx里点一个按钮打开一个excle,发现打开不了。

    第三步:

       

     System.Web.HttpResponse httpresponse = Response;
                    httpresponse.HeaderEncoding = System.Text.Encoding.GetEncoding("gb2312");
                    httpresponse.Charset = "GB2312";
                    IELang.DownloadFile(this.Page, Path.GetFileName(strWrongPath), strWrongPath);
    

    解决方式。

    第二步改成如下:

    Response.Redirect("D.aspx?rnd="+Guid.NewGuid());

    D.apsx代码如下

    <frameset rows="550,*,*" cols="670" frameborder="no" border="0" framespacing="0">
    
        <frame name="Content" id="Content" src="C.aspx?rnd=math.random()" scrolling="auto" frameborder="NO" border="0" framespacing="0" ></frame> </frameset>
    

    这样就可以了。别忘记C里加上 <base target="_self"/>

  • 相关阅读:
    牛客练习赛51
    [HZOI 2016] 偏序(CDQ套CDQ)
    AtCoder Beginner Contest 140
    [国家集训队] 拉拉队排练
    [CF91B] Queue
    [AT3867] Digit Sum 2
    [TJOI2007] 路标设置
    [HNOI2001] 求正整数
    [十二省联考2019] 异或粽子
    [SDOI2013] 直径
  • 原文地址:https://www.cnblogs.com/xbding/p/3599086.html
Copyright © 2011-2022 走看看