点按钮弹出新页面

hailiu123 2010-04-12 12:00:28
想要实现点击一个按钮弹出一个新页面,原页面不刷新,原页面上有dropdownlist 和文本框等东西,求点按钮后 DropDownList 选择的项不变,文本框内容也不能清空

目前是这样弹出页面的

Response.Write("<script>window.open('xxx.aspx?sr=" + sr + "','_blank')</script>");
...全文
96 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
hailiu123 2010-04-12
  • 打赏
  • 举报
回复
补充一下,sr 就是原页面控件中的值,不是固定的
wx8849 2010-04-12
  • 打赏
  • 举报
回复
弹出页面?
sxy445566 2010-04-12
  • 打赏
  • 举报
回复
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>

<body>
<form action="http://news.sina.com.cn" method="get" name="form1" target="_blank" id="form1">
<label>
<input type="submit" name="Submit" value="提交" />
</label>
</form>
</body>
</html>

在action是动作...动作的内容就是打开http://news.sina.com.cn
target="_blank" 是以新页面打开...

你将上面的内容保存到aaa.html然后运行一下就知道了...

-------------------------------------------

以上内容是搜索出来的
指间的风 2010-04-12
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 criedshy 的回复:]

btn.Attribute.Add("onclick","return PopPage('"+sr+"');");

funtion PopPage(sr)
{
window.open('xxx.aspx?sr=sr','_blank');
return false;
}
[/Quote]

二楼 正解,在客户端完成。
不提交服务器就可以了。
criedshy 2010-04-12
  • 打赏
  • 举报
回复
js写错了

funtion PopPage(sr)
{
window.open("xxx.aspx?sr="+sr+","_blank");
return false;
}
jin225 2010-04-12
  • 打赏
  • 举报
回复
那个按钮 跳转要执行事件吗 不要执行的话
就不要用cs些代码 了 直接
<input type="button" value="返回" onclick="javascript:history.back()" />
改下onclick事件
criedshy 2010-04-12
  • 打赏
  • 举报
回复
btn.Attribute.Add("onclick","return PopPage('"+sr+"');");

funtion PopPage(sr)
{
window.open('xxx.aspx?sr=sr','_blank');
return false;
}
criedshy 2010-04-12
  • 打赏
  • 举报
回复
如有个DropDownList ddl

在Page_Load中就可以这样写,

btn.Attribute.Add("onclick","return PopPage('"+ddl.SelectedValue+"');");


criedshy 2010-04-12
  • 打赏
  • 举报
回复
funtion PopPage(sr)
sr就是你页面要传的值

62,074

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧