Asp.net 与 jsp 交互 (打开或跳转页面)
//// 打开固定大小窗体
Response.Write("<script>window.open('Tree1_edit.aspx','child','width=300,height=215,left=200,top=200')</script>");
//// 直接关闭不提示
ClientScript.RegisterStartupScript(Page.GetType(), "", "<script language=javascript>window.opener=null;window.open('','_self');window.close();</script>");
//// 在子页面跳出父框架直接到登录页
ClientScript.RegisterStartupScript(Page.GetType(), "", "<script language=javascript>parent.document.location.href='Login.aspx'</script>");
//// 在子页面关闭父框架
ClientScript.RegisterStartupScript(Page.GetType(), "", "<script language=javascript>window.parent.opener=null;window.parent.open('','_self');window.parent.close();</script>");
//// 弹出对话框
ClientScriptManager scriptManager = ((Page)System.Web.HttpContext.Current.Handler).ClientScript;
//scriptManager.RegisterStartupScript(typeof(string), "", "alert(' 提示: 您输入的内容已经存在,请输入其他的内容, 以保证内容的唯一性! ');", true);
//scriptManager.RegisterStartupScript(typeof(string), "", "alert(' 提示: 您输入的内容已经存在,请输入其他的内容, " + TextBox2.Text.Trim().ToString() + " 以保证内容的唯一性! ');", true);
// 弹出对话框 换行
scriptManager.RegisterStartupScript(typeof(string), "", "alert(' 提示: 您输入的内容已经存在,请输入其他的内容, \\r\\n 以保证内容的唯一性! ');", true);
////
//原窗口保留,以对话框形式打开新窗口:(打开窗口的大小可以设置打开页面的大小)
Response.Write("<script>window.showModelessDialog('PIE_Project2.aspx')</script>");
////刷新
刷新本页:
Response.Write("<script language=javascript>window.location.href=window.location.href;</script>")
刷新父页:
Response.Write("<script language=javascript>opener.location.href=opener.location.href;</script>")
转到指定页:
Response.Write("<script language=javascript>window.location.href='yourpage.aspx';</script>")
//// Asp.net 与 Jsp 参考 (Tx)
//OpenWindow
Response.Write("<script language='javascript'>window.open('" + pageUrl + "','" + pageName + "',\"scrollbars='yes',width=" + width + ",height=" + height + ",top=250px,left=300px\")</script>");
Response.Write("<script language='javascript'>window.open('" + pageUrl + "','" + pageName + "',\"scrollbars='yes',width=" + width + ",height=" + height + ",top=" + top + "px,left=" + left + "px\")</script>");
//OpenWindowDiaglog
Response.Write("<script language='javascript'>window.showModalDialog('" + pageUrl + "','" + pageName + "',\"center:yes;scroll:yes;dialogWidth:" + width + "px;dialogHeight:" + height + "px;dialogTop:150px;dialogLeft:200px;status:no;\")</script>");