首先,你要清楚,js是在客户端运行。服务器端的代码先执行
2,客户端的数据要在服务器端使用,要进行一次提交。
参考
http://dotnet.aspx.cc/ShowDetail.aspx?id=49ML4AO8-5PB3-4KNY-NJZD-LJOIOXV4M1X4

解决方案 »

  1.   

    这么说我在关闭新打开的窗口,无法重新绑定主页面的datagrid了?
      

  2.   

    关闭新打开的窗口是可以重新绑定主页面的datagrid,在关闭窗口后,要提交主页面,来重新绑定dataGrid
      

  3.   

    关闭窗口的事件js在window.onunload()中
      

  4.   

    如何重新提交呀?它的父窗口是什么?top?opener?
      

  5.   

    这么写  你试试!
    string s_tmp="<script language = 'JavaScript'>window.showModalDialog";
    s_tmp += "('stock_plan_detail_input.aspx?bill_id="+s_bill_id;
    s_tmp +="&materiel_id="+s_materiel_id+"&s_name="+System.Web.HttpUtility.UrlEncode(s_name);
    s_tmp +="'top=150,left=200,width=100,height=100,toolbar=no,status=no');return true</script>);";
    this.Page.RegisterStartupScript("2004070201",s_tmp);
    然后在stock_plan_detail_input.aspx这个界面里 , 点击确定时定义一个Session变量,
    在返回按钮中Response.Write("<script>window.close()</script>")就可以
    还有就是在stock_plan_detail_input.aspx的page_load 里写上Response.Write("<base target=_self />");
    if ()//判断你定义的Session变量是不是空!!!
    {
       BindGrid();  
       Session.Remove("你定义的Session变量的名称");
    }
    这样就可以刷新了  !!
      

  6.   

    呵呵,用Session,我倒是想过了,看来现在没别的办法了,试试它了。
      

  7.   

    不行,关闭新窗口时,不执行if ()//判断你定义的Session变量是不是空!!!
    {
       BindGrid();  
       Session.Remove("你定义的Session变量的名称");
    }
    因为是服务器代码,已经先执行了。
      

  8.   

    把返回值放到一个hidden中,然后用
    if (hidReturn=="ok")此处如何引用上面js中的aa变量加以判断返回值?
    {
       BindGrid();  
    }