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帮忙做到了。
  • 相关阅读:
    网络爬虫基础练习
    Hadoop综合大作业
    hive基本操作与应用
    用mapreduce 处理气象数据集
    熟悉常用的HBase操作
    爬虫大作业
    第三章 熟悉常用的HDFS操作
    数据结构化与保存
    获取全部校园新闻
    爬取校园新闻首页的新闻
  • 原文地址:https://www.cnblogs.com/zhangpengshou/p/822363.html
Copyright © 2011-2022 走看看