在做公司的网站,在首页实现公司邮局的登录入口,需要转入参数,即Redirect(http://***.****/**&username=**&pa...);
然而这样会在原页面打开新页面,而邮局里面没有链接回到公司主页,很是麻烦.后来找到了用注册脚本的方法.
strScript += "<script type='text/javascript'>/n";
strScript += "window.open('http://*.*/login_submit.jsp?username=" + username + "&hostname=xmxjjl.com&password=" + password + "','_blank');/n";
strScript += "location.href='/';";
strScript += "</script>";
bool b = ((Page)System.Web.HttpContext.Current.Handler).IsStartupScriptRegistered("PopUp");
if (!b)
{
((Page)System.Web.HttpContext.Current.Handler).RegisterStartupScript("PopUp", strScript);
}
与大家共享