框架网页之间如何传递参数

hantao2000 2003-09-15 09:56:57
定义框架网页如下
<frameset cols="218,74%">
<frame name="contents" scrolling="no" noresize marginwidth="0" marginheight="0" src="1.aspx">
<frame name="main" scrolling="no" noresize marginwidth="0" marginheight="0" src="2.aspx>
</frameset>
当点击1.aspx中的按钮,发射到2.aspx,用c#怎么写。
...全文
137 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
比尔咔咔 2003-09-26
  • 打赏
  • 举报
回复
1.思归
private void Button1_Click(object sender, System.EventArgs e)
{
Response.Redirect("<script language=javascript>parent.frames['右边的框架Name'].location.href='xxx.aspx';</" + "script>");
}

2. fengyun6(風雲)
private void Button1_Click(object sender, System.EventArgs e)
{
Response.Redirect("<script language=javascript>parent.frames['Right.aspx'].location.href='xxx.aspx';</script>");
}

3.warfen(菜鸟)
我近期经常用到这个.比如有两个框架,<iframe frameborder="no" scrolling="auto" width="25%" name="left" src="left.aspx" height="100%"></iframe> ; <iframe frameborder="no" scrolling="auto" width="75%" name="right" src="right.aspx" height="100%"></iframe>.关键是要给框架命名.现在在name="left"的框架中有一个叫left.aspx的文件,其中有一个链接,比如<a href="xxx.aspx" target="right">链接一</a>,这样就能点击左边的页面,在右边显示xxx.aspx.关键是设置"target=".其实不需要服务器控件,如果你要用,可以用hyperlink或linkbutton这两个控件都有targer属性,设置好就行了.

4. cnhgj(戏子.Com?俺真TMD够菜)
Response.Write("<Script>parent.RightFrame.location.href='xxx.aspx';</Script>");

5. net_lover(孟子E章)
Response.Write("<Script>window.open('xxx.aspx','RightFrame')</Script>");

6. hiaming(阿明)

上面说的都可以的,关键在你的右框架名字是不是对应代码中的名字
如:
warfen(菜鸟)
我近期经常用到这个.比如有两个框架,<iframe frameborder="no" scrolling="auto" width="25%" name="left" src="left.aspx" height="100%"></iframe> ; <iframe frameborder="no" scrolling="auto" width="75%" name="right" src="right.aspx" height="100%"></iframe>.关键是要给框架命名.现在在name="left"的框架中有一个叫left.aspx的文件,其中有一个链接,比如<a href="xxx.aspx" target="right">链接一</a>,这样就能点击左边的页面,在右边显示xxx.aspx.关键是设置"target=".其实不需要服务器控件,如果你要用,可以用hyperlink或linkbutton这两个控件都有targer属性,设置好就行了.

name="right"
^^^^^^^^^^^^^^这个name的值就是它的名字,你在hyperlink控件中设置
target="right"就行了,还有要注意的事你的多框架页面中不能有同名的框架
hantao2000 2003-09-15
  • 打赏
  • 举报
回复
必须在按钮事件中接受数据
HenanBoy 2003-09-15
  • 打赏
  • 举报
回复
简单的方法
<frameset cols="218,74%">
<frame name="contents" scrolling="no" noresize marginwidth="0" marginheight="0" src="1.aspx?这里写要传递的参数和数据就下同">
<frame name="main" scrolling="no" noresize marginwidth="0" marginheight="0" src="2.aspx>
</frameset>
这样就可以在1.aspx和2。aspx上面接受数据了
hantao2000 2003-09-15
  • 打赏
  • 举报
回复
怎末不行呢
xhzuo 2003-09-15
  • 打赏
  • 举报
回复
接收时,用你要传递的参数的名字啊
hantao2000 2003-09-15
  • 打赏
  • 举报
回复
直接写“button”还是写按钮的名称;
seesea125 2003-09-15
  • 打赏
  • 举报
回复
<frameset cols="218,74%">
<frame name="contents" scrolling="no" noresize marginwidth="0" marginheight="0" src="1.aspx" target="main"> //指向另一页面
<frame name="main" scrolling="no" noresize marginwidth="0" marginheight="0" src="2.aspx>
</frameset>
点击按钮后的事件
Response.Redirect("<a herf=2.aspx?id=1>button</a>");
2.aspx中用request("id")接收
aspiresc 2003-09-15
  • 打赏
  • 举报
回复
学习
xavier_lee 2003-09-15
  • 打赏
  • 举报
回复
session("message")="your args"

in button_click(...):
dim strid as string

strid = ctype(session("message"),string)
...

'do your things

seesea125 2003-09-15
  • 打赏
  • 举报
回复
可以是按钮,也可以是hyperlink控件等其它的

62,041

社区成员

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

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

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

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