用下面的这个函数弹出窗口对数据库进行更新,数据库更新了,可是datagrid显示没有更新
function btnUpdateClient_onclick(selId) {
                var x =event.screenX - 120;
var y = event.screenY + 10;
       var strTemp = window.showModalDialog("S_Dept_Edit.aspx?operType=0&strDeptNo="+selId,"_blank","dialogHeight:200px;dialogWidth:260px;dialogTop:"+y+";dialogLeft:"+x+";center:yes;resizable:no;scroll:no;status:no;help:no");
if(strTemp!="")
{
window.alert("aback");
window.location.reload(window.location.href);
    }
}
请教各位朋友,十万火急,谢谢大家了!

解决方案 »

  1.   

    this.dataSet11.authors .Clear (); //清空,重新填充....
     this.sqlDataAdapter1.Fill (this.dataSet11.authors );
    this.DataGrid1.DataSource=this.dataSet11 .authors ;
      

  2.   

    this.dataSet11.authors .Clear (); //清空,重新填充....
     this.sqlDataAdapter1.Fill (this.dataSet11.authors );
    this.DataGrid1.DataSource=this.dataSet11 .authors ;
      

  3.   

    authors //是表名,你根据你的便变一下....
      

  4.   

    if(strTemp!=null)
    {
    window.alert("aback");
    window.location.reload(window.location.href);
    }
      

  5.   

    执行后加上下边重新bind
    this.dataSet11.authors .Clear (); //清空,重新填充....
    this.sqlDataAdapter1.Fill (this.dataSet11.authors );
    this.DataGrid1.DataSource=this.dataSet11 .authors ;
     this.datagrid1.databind(); //这加了没???
      

  6.   

    问题是,你这一句
    if(strTemp!="")
    在更新的时候,有没有返回值呢?
    如果还不行,你可以在页面中放一个按钮,然后,更新结束之后,用脚本点击此按钮,在按钮事件里面重新加载
    document.all("button1").click();
    这样肯定可以刷新的.
      

  7.   

    你的页面刷新了吗?如果想你说的情况你的页面应该没有刷新,只是重新load了缓存
    你可以试下在你的url后边加个?1试试
      

  8.   

    mathsword(梦在流浪),怎么加缓存.
      

  9.   

    在页面加载事件里写上datagrid绑定的语句,更新完成后,刷新页面,grid也就重新加载了。