zoukankan      html  css  js  c++  java
  • showModalDialog注意事项

    用Javascript 打开一个modalDialog时,IE常常会缓存这个Page。同时用XMLHttpRequest的Send进行请求的时候,IE也会缓存这个Page。如何解决?
    (1) 在要打开或要请求的Url后面多加一个随机参数,来避免页面被缓存,随便加一个什么都行,只要每次都不一样。
    var url = Page.aspx?Id=0&temp= + Math.random();
    window.showModalDialog(url, , status:no; help:no;);
    (2) 在该asp.net 页面的 Page_Load 方法里设定不缓存。
    protected void Page_Load(object sender, EventArgs e){
    Response.Expires = 0;
    Response.Cache.SetNoStore();
    Response.AppendHeader("Pragma", "no-cache");
    }
    或者
    protected void Page_Load(object sender, EventArgs e){
    this.Response.CacheControl = "no-cache";
    }

    如果这个modalDialog页面上有form.submit(),用Asp.Net开发时这个submit会在客户端打开一个新的IE,而不是在那个modalDialog上更新,这时候该怎么办?
    (1) 需要给打开的那个modalDialog的父页面的Html的Head部分添加
    <base target=_self></base> 这样一段话。

    (2) 先实现一个模态对话框页面文件****Frame.aspx,在其中写上
    <body>
    <iframe width=600 height=400 name=aa frameborder=0 src="****Task.aspx"></iframe>
    </body>
    然后 实现****task.aspx页面文件,这个是真正提供用户内容输入和提交的页面。套的这个iframe帮忙做到了。
  • 相关阅读:
    实现Runnable接口和继承Thread类的区别
    图的DFS和BFS
    图建模
    数据结构-图的基本知识和表示
    除自身以外的乘积数组(力扣第238题)
    MapReduce源码分析--Shuffle阶段
    转到博客园
    vue中使用剪切板插件 clipboard.js
    vue中使用vue-qrcode生成二维码
    h5中嵌入视频自动播放的问题
  • 原文地址:https://www.cnblogs.com/zhangpengshou/p/822363.html
Copyright © 2011-2022 走看看