我用这个函数 显示模态对话框:
      string url = "UserUpdate.aspx";
                    url += "?usxm=" + gr.Cells[1].Text ;
                    ShowDialog(url, "600", "380");  
                    break;  url 表示的这个页面 只有第一次模态显示时 走Page_Load 第二次显示时 就不走 为什么? url里面的 Page_Load 如下:   /// <summary>
    /// 画面加载
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Page_Load(object sender, EventArgs e)
    {
       //初始化
        if (!IsPostBack)
        {
            Initialize();           
        }       
    }
ShowDialog 函数为:
 /// <summary>
    /// 弹出窗口
    /// </summary>
    /// <param name="PagePath"></param>
    protected void ShowDialog(string PagePath, string width, string height)
    {
        string strScript = "var reload = window.showModalDialog('" + PagePath + "',window,'";
        strScript += "dialogWidth:" + width + "px;";
        strScript += "dialogHeight:" + height + "px;";
        strScript += "help:no;status:no;scroll:no');";
        strScript += "if (reload == 1) window.location.reload();";
        ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "ShowDialog", strScript, true);
   
    }

解决方案 »

  1.   

    你把那个page_load中的那个判断去掉
    那个判断是只有在第一次导入页面的时候才运行里面的东西!
      

  2.   

    解决了 HTML方面        <meta http-equiv="pragram" content="no-cache">        禁止浏览器从本地缓存中调阅页面。        网页不保存在缓存中,每次访问都刷新页面。        <meta http-equiv="cache-control" content="no-cache, must-revalidate">        同上面意思差不多,必须重新加载页面        <meta http-equiv="expires" content="0">        网页在缓存中的过期时间为0,一旦网页过期,必须从服务器上重新订阅。        .NET方面        Response.Expires = -1;