protected void imgReviseModify_Click(object sender, ImageClickEventArgs e)
{ BOM objBOM = new BOM(); MaterialStatistics objMaterialStatistics = new MaterialStatistics(); objBOM.AddOberver(objMaterialStatistics); objBOM.AddOberver(new PackForm()); try { if (PresetMessage1.Value == "") { this.Response.Write("<script>alert('" + Resources.Common.InputReason + "');</script>"); } else { objBOMInfo.Reason = PresetMessage1.Value; objBOMInfo.Subject = Resources.Common.REVISE_RESONSE; objBOM.ReviseBOM(objBOMInfo); string srtOpenEditPage = "OpenFixSizeWindow('" + URLBase + "/MaterialManagement/BOMNew/bom_edit.aspx?bomid=" + bomID + "','Display" + bomID + "');"; string script = string.Format("<script language='javascript'>{0} window.close();</script>", srtOpenEditPage); Page.ClientScript.RegisterClientScriptBlock(typeof(bom_revise), "close", script);}
} catch (SyncFlo.SyncFloSystem.Exceptions.RecoverableException exp) { Misc.ShowRecovableException(this.Page, exp.Message); } catch (Exception err) { string strScript = "<script language='javascript'>alert('" + err.Message + "');window.returnValue='OK';window.close();</script>"; Page.ClientScript.RegisterClientScriptBlock(typeof(bom_revise), "alert", strScript); }}
主要将两个脚本一起传给另一个页面,很简单重新格式化一下就OK,下面是不可取的,但涉及到许多引号的使用问题,测试了很多,只做个保留。
//Response.Write("<script>OpenFixSizeWindow('"+URLBase + "/MaterialManagement/BOMNew/bom_edit.aspx?bomid=" + bomID +";')';</script>");
//string script = "<script language='javascript'>window.opener.parent.location.reload();</script>"; //imgReviseModify.Attributes[" = "OpenFixSizeWindow('" + URLBase + "/MaterialManagement/BOMNew/bom_edit.aspx?bomid=" + bomID + "," + strUrl + "');"; //"<script>top.location.href= '" + URLBase + "/MaterialManagement/BOMNew/bom_edit.aspx?bomid=" + bomID; +"' </script>"; //Response.Write("<script language='javascript'>OpenFixSizeWindow('" + URLBase + "/MaterialManagement/BOMNew/bom_edit.aspx?bomid=" + bomID + ",Display" + bomID + ";',_self')</script>"); //Response.Write("<script>windows.open('" + URLBase + "/MaterialManagement/BOMNew/bom_edit.aspx?bomid=" + bomID + ",Display" + bomID + "',',Display"+bomID+"');</script>"); //Response.Write("<script language='javascript'>OpenFixSizeWindow('"+URLBase + "/MaterialManagement/BOMNew/bom_edit.aspx?bomid=" + bomID + ",Display" + bomID +";')';</script>"); //Response.Write("<script>windows.open('"+ strUrl +"',',Display" + bomID + "');</script>"); //Response.Write("parent.mainFrameBottom.location.href='URLBase + /MaterialManagement/BOMNew/bom_edit.aspx?bomid=" + bomID + "';"); //Response.Write("<script language='javascript'>OpenFixSizeWindow('" + URLBase + "/MaterialManagement/BOMNew/bom_edit.aspx?bomid=" + bomID + "','Display" + bomID + "');</script>"); //string strUrl = URLBase + "/MaterialManagement/BOMNew/bom_edit.aspx?bomid=" + bomID; //Response.Redirect(strUrl); //Response.Write("<script language='javascript'>windows.open('" + URLBase + "/MaterialManagement/BOMNew/bom_edit.aspx?bomid=" + bomID + ",'Display+"+bomID+"'');</script>");//比较标准,但会出现 //Response.Write("<script language='javascript'>RefreshWindowOpenner(window.opener, '"+URLBase + "/MaterialManagement/BOMNew/bom_edit.aspx?bomid=" + bomID+"');window.close();</script>");