在html里调用如下

函数打开窗口  
  function   openaddcalendar()  
  {  
  var   width=210;  
  var   height=180;  
  var   surl='../openwindow.aspx?url=calendar.aspx';  
  var   returnVal;  
  returnVal=window.showModalDialog   (surl   +   '&width='   +   width   +'&height='+   height   ,'','dialogWidth='   +   width   +   'px;dialogHeight='   +   height   +   'px;resizable=no;help=no;center=yes;status=no;scroll=no;edge=sunken');  
  if   (returnVal=="True")  
  {  
  window.location.href=window.location.href;  
  window.location.reload;  
  }  
  }  
  如果需要判断是否刷新父窗口,就判断这个返回值,  
  这个返回值returnVal需要从模态窗口中返回  
    也就是                           Response.Write("<script   language=javascript>")  
                          Response.Write("window.returnValue='True';window.close()")  
                          Response.Write("</script>")  
  当然,如果用户直接点“X”来关闭窗口,就没法刷新了  
   
  如果不需要判断,就直接  
  window.location.href=window.location.href;  
  window.location.reload;  
  好了

相关文章: