There can be no Triumph without Loss,No Victory without Suffering,No Freedom without Sacrifice.
All you have to decide is what to do with the time that is given to you.
Get busy Living, or Get busy Dying?
  首页 | 留言给我 | 订阅 Rss | CLI | 黄白之恋 Posts:158   Hits: 5068094    Comments: 173    
 日历归档
<<  <  2024 - 04  >  >>
SuMoTuWeThFrSa
 123456
78910111213
14151617181920
21222324252627
282930
 About Me
 Name: ZhangSichu
 Sex: Male
 Age: 32
 Email: ZhangSichu@gmail.com
 MSN: ZhangSichu@hotmail.com
 Home: ZhangSichu.com
 WeiBo: weibo.com/zhangsichu
 个人推荐
 分类归档
  ·C++/C(5)  RSS
  ·软件工程(1)  RSS
  ·杂事/随感(26)  RSS
  ·.Net/Java(30)  RSS
  ·面向对象程序设计(5)  RSS
  ·汇编/破解(0)  RSS
  ·平面设计(3)  RSS
  ·SQL(5)  RSS
  ·COM/COM+(2)  RSS
  ·Web开发(81)  RSS
 My Friends
Back Forward Refresh Home 2024年4月23日 星期二 RSS CLI Mine Sweeper. In Javascript.

  SomeWebModelDialogTips
字体大小 [ ]

SomeWebModelDialogTips 原始信息来在公司的Community Server,经过自己补充和整理。

用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帮忙做到了。
  Posted @ 12/21/2006 1:56:00 PM | Hits (22193) | Comment (0

  Post Comment
标题 *
作者 *
密码 记住我
评论 *
    


Stable in Firefox 1.5 2.0Stable in IE6 IE7Stable in MozillaStable in Netscape
ZhangSichu.com V0.1.7507
Powered By ZhangSichu
Copyright © ZhangSichu
Download ZhangSichu.com source code. Download source code