问题是这样的:我有一个框架分left ,right两个页面,在right页面中有一个GRIDVIEW显示数据,当单击GRIDVIEW任意行时显示一个模态窗口,用来修改记录,更新后关闭模态窗口。问题是关闭后不能刷新框架里的right页面,GRIDVIEW显示得数据还是修改前的数据。试了好多方法都不行。我的代码如下:单击GRIDVIEW任意行时显示一个模态窗口的代码:
 protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        
        if (e.Row.RowType == DataControlRowType.DataRow)
        {            e.Row.Attributes.Add("onclick", "window.showModalDialog( 'SunStudio_bzxq.aspx?bzxh_id=" + e.Row.Cells[0].Text + " ',window, 'dialogWidth=650px;dialogHeight=500px;help:no;status:no ')");        }
    }更新记录后关闭模态窗口代码:
  protected void Button1_Click(object sender, EventArgs e)
    {Response.Write("<script>window.alert('修改成功!');window.opener=null;window.close();</script>");
Response.Write("window.dialogArguments.location.assign('Main_Edit.aspx');");}
程序执行时Button1_Click事件时,关闭了模态窗口,但没有刷新父页面。请大家帮我看看,实在是没招了,我觉得是参数传递的问题。

解决方案 »

  1.   

          ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('确认成功');window.close();window.opener.location.href = window.opener.location.href;</script>");
                    //提示确认成功并且,关闭然后刷新父窗口
      

  2.   

    yuan74521940:还是不能刷新,再顶
      

  3.   

     e.Row.Attributes.Add("onclick", "window.showModalDialog(  'SunStudio_bzxq.aspx?bzxh_id=" + e.Row.Cells[0].Text + "  ',window,  'dialogWidth=650px;dialogHeight=500px;help:no;status:no  ');window.location.href=window.location.href; ");