private void RefreshParentPage()
{
StringBuilder sb = new StringBuilder();
sb.Append("<script>\n");
sb.Append("var pWindow = window.parent.opener;\n");
sb.Append("if(pWindow != null && pWindow.document.all.btnQuery != null)\n");
sb.Append("{pWindow.document.all.hfRefresh.value=1;pWindow.document.all.btnQuery.click();}\n");
sb.Append("pWindow = window.parent.parent;\n");
sb.Append("if(pWindow != null && pWindow.gridframe != null && pWindow.gridframe.document.all.btnQuery != null)\n");
sb.Append("{pWindow.gridframe.document.all.hfRefresh.value=1;pWindow.gridframe.document.all.btnQuery.click();}\n");
sb.Append("</script>");
this.ClientScript.RegisterStartupScript(this.GetType(), "refreshparent", sb.ToString());
}