不用redirect,新开一个窗口的问题。 用redirect原来那个浏览器就会装载一个新窗口,而消失,可以有什么语句可以新开一个窗口来装载内容。而原来那个窗口还能保留,并且,最好那个窗口的大小,我还能控制,谢谢。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 window.open("要在新窗口中打开的窗体的名称",'','toolbar=no, //是否显示工具栏location=no, //是否显示地址栏status=no, //是否显示状态栏menubar=no, //是否显示菜单栏scrollbars=no, resizable=no,width=600,height=420,left=200,top=50') 在想開新頁面的地方寫response.write("<script> java_renyusheng(任玉胜) 的代碼</script>") 好像不能在 aspx.cs文件中直接调用的吧。他应该是javascript语言。 window.open("xxx.aspx","","toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizeable=no,width=800,height=600,top=0,left=0"); string strScript = "window.open('xxx.aspx','','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizeable=no,width=800,height=600,top=0,left=0');";if (!Page.IsStartupScriptRegistered("open")){ Page.RegisterClientScriptBlock("open","<script language='javascript'>" + strScript + "</script>");} 好像不能在 aspx.cs文件中直接调用的吧。他应该是javascript语言。---------------------------------------------------------------谁说的,类似private void Button1_Click(object sender, System.EventArgs e){ Response.Write("<script>window.open('xxx.aspx','','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizeable=no,width=800,height=600,top=0,left=0')</script>");} Response.Write("<sript>window.open(...)</script>")这样在页面呈现之后会将上面的脚本输出到页面的最顶部,也就是说当该页面刷新时就会输出上面的脚本来打开一个新的窗口,所以你要选择在什么情况下输出该脚本到浏览器上。 服务器private void Page_Load(object sender, System.EventArgs e) { Button1.Attributes.Add("onclick","openmessagewin()"); }客户端:<script> function openmessagewin() { window.open ("MESSAGE/ShowMessage.aspx", "信息窗口", "height=200, width=500, toolbar =no, menubar=no, scrollbars=yes, resizable=no, location=no, status=no") } </script> Response.Write("<script>window.open('index.htm','Sample','toolbar=yes,location=no,directories=no,status=no,menubar=yes,scrollbars=no,resizable=no,copyhistory=yes,width=300,height=200,left=100,top=100')</script>");<!--说明:将其中的链接文件test.htm改为你的路径,窗口参数如下: toolbar=yes, 显示工具条location=yes,显示网址栏directories=no,导航条status=no,状态条menubar=yes,菜单scrollbars=yes,滚动条resizable=no,是否可以改变大小copyhistory=yes,历史按钮width=300,宽height=200'高left=1000,距离左边100top=100,距离顶端100--> Response.Write("<script>window.open('index.htm','Sample','toolbar=yes,location=no,directories=no,status=no,menubar=yes,scrollbars=no,resizable=no,copyhistory=yes,width=300,height=200,left=100,top=100')</script>"); 1.Response.Write("<script>alert('in the past!!!');</script>");2.window.open('"+strPrintPage+"','PrintPage','toolbar=yes,width=800,height=600,status=yes,scrollbars=yes,resizable=yes,menubar=yes'); 子页给母版页flah赋值 关于登录验证问题!!! 求问网站安全问题 关于CS代码编写的安全性... 将 varchar 值 转换成数据类型 int 时失败 怎么把图片贴到doc文档的一个表格中还要把它打印出来? textbox问题 请教Excel导入数据库出错的问题! asp.net session 购物车问题 为什么我执行存储过程插入一条记录反回的值是0 一定给高分 怎样在.NET作的网页中嵌入.fla文件 ********************* cookie是否可以存数组??? ********************* 保留2位小数的问题
"要在新窗口中打开的窗体的名称",
'',
'toolbar=no, //是否显示工具栏
location=no, //是否显示地址栏
status=no, //是否显示状态栏
menubar=no, //是否显示菜单栏
scrollbars=no, resizable=no,width=600,height=420,left=200,top=50')
if (!Page.IsStartupScriptRegistered("open"))
{
Page.RegisterClientScriptBlock("open","<script language='javascript'>" + strScript + "</script>");
}
谁说的,类似
private void Button1_Click(object sender, System.EventArgs e)
{
Response.Write("<script>window.open('xxx.aspx','','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizeable=no,width=800,height=600,top=0,left=0')</script>");
}
这样在页面呈现之后会将上面的脚本输出到页面的最顶部,也就是说当该页面刷新时就会输出上面的脚本来打开一个新的窗口,所以你要选择在什么情况下输出该脚本到浏览器上。
private void Page_Load(object sender, System.EventArgs e)
{
Button1.Attributes.Add("onclick","openmessagewin()");
}客户端:
<script>
function openmessagewin() {
window.open ("MESSAGE/ShowMessage.aspx", "信息窗口", "height=200, width=500, toolbar =no, menubar=no, scrollbars=yes, resizable=no, location=no, status=no")
}
</script>
location=yes,显示网址栏
directories=no,导航条
status=no,状态条
menubar=yes,菜单
scrollbars=yes,滚动条
resizable=no,是否可以改变大小
copyhistory=yes,历史按钮
width=300,宽
height=200'高
left=1000,距离左边100
top=100,距离顶端100-->
2.window.open('"+strPrintPage+"','PrintPage','toolbar=yes,width=800,height=600,status=yes,scrollbars=yes,resizable=yes,menubar=yes');