我在datagrid里加入了一个弹出框。从a页中弹出b 页,
如果不加window.location='a.aspx';这句a 页变成空白页显示 [object].   
 如果加上的话他就要刷新a页。怎么才能不刷新啊。javascript:varwin=window.open('b.aspx?ID={0}','win','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,left=250,top=250,width=500,height=300');window.location='a.aspx';谢谢!

解决方案 »

  1.   

    是在datagrid格式化字段中加入的!
      

  2.   

    这样实现会比较好
    private void DataGrid1_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
            {
                if(e.Item.ItemIndex>-1)
                {
                    string id = e.Item.Cells[0].Text;
                    e.Item.Attributes.Add("onclick","window.open('b.aspx?ID="+id+"','win','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,left=250,top=250,width=500,height=300');");
                }
            }
      

  3.   

    但在datagrid里还有什么好办法吗?