asp.net 框架集问题,高手请进!!分全给第一个解决问题的人

wb000wb 2004-09-14 03:27:54
我做了一个框架集,分左右两边,现已加载了两个不同的页面,问如何点击左边网面上的按钮时在右边打开新页面,注:此按钮是服务器铵钮。
...全文
157 15 打赏 收藏 转发到动态 举报
写回复
用AI写文章
15 条回复
切换为时间正序
请发表友善的回复…
发表回复
ny_nicholas 2004-09-14
  • 打赏
  • 举报
回复
收一下mail,寄給你了
ny_nicholas 2004-09-14
  • 打赏
  • 举报
回复
index.asp 和left.asp要放在同一目錄下
happyjun2000 2004-09-14
  • 打赏
  • 举报
回复

1. <asp:Button ID=button1 Runat=server Text=button1></asp:Button>
2.
<script language=javascript for="button1" event="onclick()">
<!--
//你在button的onclick脚本里面写类似代码
window.parent.frames["mainFrame"].location.href="../MyTest/Test1.aspx"
//-->
</script>
wb000wb 2004-09-14
  • 打赏
  • 举报
回复
wb000wb@163.com
谢了,
980337 2004-09-14
  • 打赏
  • 举报
回复
两个加载页面的地方没有名字吗?
直接 target="name"
不行吗?
ny_nicholas 2004-09-14
  • 打赏
  • 举报
回复
有mail嗎,我可將代碼完整發給你
捏造的信仰 2004-09-14
  • 打赏
  • 举报
回复
window.parent.frames("Main").location="www.sohu.com"
随便参照网上的网页都可以呀,比如QQ论坛的那种样子
ny_nicholas 2004-09-14
  • 打赏
  • 举报
回复
以下是index.asp的完整代碼,你參考一下吧
<html>
<head>
<title>xxxx</title>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
<script language="JavaScript">
<!--
window.status="xxxxx";
//-->
</script>
</head>

<frameset rows="*,23" frameborder="NO" border="0" framespacing="0">
<frameset cols="122,*" frameborder="YES" border="1" framespacing="1">
<frame name="leftFrame" scrolling="no" noresize src="left.asp" target="rtop">
<frame name="mainFrame" src="wnl.asp" scrolling="auto" noresize>
</frameset>
<frame name="bottomFrame" scrolling="no" noresize src="include/bottom.asp">
</frameset>

<noframes>
<body bgcolor="#FFFFFF" text="#000000" topmargin="0" leftmargin="0">
對不起,您的瀏覽器不支持框架結構,請換用能支持框架結構的瀏覽器。
<br><br>
例如,可以使用 Microsoft Internet Explorer 4.0(簡稱 IE 4.0) 以上版本的瀏覽器!
<br><br>

<body bgcolor="#fef4d9" onunload="bookmark()">
</body>
</noframes>
</html>
wb000wb 2004-09-14
  • 打赏
  • 举报
回复
是的,按你的做的,就是index中有错:未能找到frame的任何target属性
2002pine 2004-09-14
  • 打赏
  • 举报
回复
左边的button1_click
{
Response.write("<script>window.top.frames["右边的FRAME名字"].src='www.csdn.net';</script>");
}
ny_nicholas 2004-09-14
  • 打赏
  • 举报
回复
下面的代碼是在index.asp中的
<frameset rows="*,23" frameborder="NO" border="0" framespacing="0">
<frameset cols="122,*" frameborder="YES" border="1" framespacing="1">
<frame name="leftFrame" scrolling="no" noresize src="left.asp" target="rtop">
<frame name="mainFrame" src="wnl.asp" scrolling="auto" noresize>
</frameset>
wb000wb 2004-09-14
  • 打赏
  • 举报
回复
ny_nicholas() 不行呀,网页有错,未能找到frame的任何target属性
ny_nicholas 2004-09-14
  • 打赏
  • 举报
回复
再在left.asp中加入
<base target="mainFrame">
詳見以下部份代碼

<html>
<head>
<title>left</title>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
<link rel="stylesheet" href="include/genius.css" type="text/css">
<base target="mainFrame">
<script language="JavaScript">
<!--
function sbar(Obj,col){Obj.style.backgroundColor="#CC0000";}
function cbar(Obj){Obj.style.backgroundColor="";}
function hit(Obj){Obj.style.display=(Obj.style.display=="none")?"":"none";}
//-->
</script>
</head>
<body bgcolor="#ddf3ff" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
ny_nicholas 2004-09-14
  • 打赏
  • 举报
回复
<frameset rows="*,23" frameborder="NO" border="0" framespacing="0">
<frameset cols="122,*" frameborder="YES" border="1" framespacing="1">
<frame name="leftFrame" scrolling="no" noresize src="left.asp" target="rtop">
<frame name="mainFrame" src="wnl.asp" scrolling="auto" noresize>
</frameset>
ny_nicholas 2004-09-14
  • 打赏
  • 举报
回复
No.1

62,041

社区成员

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

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

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

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