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"/>

  • 相关阅读:
    collections模块整理
    jQuery 事件
    前端开发问题点
    无线wifi
    MySQL 数据库--SQL语句优化
    MySQL 数据库--索引原理与慢查询优化
    MySQL 数据库--内置功能
    MySQL 数据库--权限管理
    MySQL -Naivacat工具与pymysql模块
    MySQL 数据库 -- 数据操作
  • 原文地址:https://www.cnblogs.com/xbding/p/3599086.html
Copyright © 2011-2022 走看看