页面跳转问题

C_SuperMe 2009-04-21 04:22:40
有一个页面a.aspx,
<form id="frm" name="frm" method="post" target="_blank" action="b.aspx"> </form>
,如何可以在调用页面a.aspx的时候直接跳到b.aspx?我在a.aspx中执行onload(document.frm.submit())没有效果。
...全文
181 22 打赏 收藏 转发到动态 举报
写回复
用AI写文章
22 条回复
切换为时间正序
请发表友善的回复…
发表回复
悔说话的哑巴 2009-04-22
  • 打赏
  • 举报
回复
protected void Page_Load(object sender, EventArgs e)
{
string x1="11"
string x2="22"
Response.Redirect("b.aspx?x1=&x2=");
}
ak4740 2009-04-21
  • 打赏
  • 举报
回复
protected void Page_Load(object sender, EventArgs e)
{//在a里写,不知道是不是这个意思呢,是不是不显示a直接跳b呢
string x1="11"
string x2="22"
Response.Redirect("b.aspx?x1=&x2=");
}
很好的方法啦
风骑士之怒 2009-04-21
  • 打赏
  • 举报
回复
存储在session
hxa165 2009-04-21
  • 打赏
  • 举报
回复
在A时把你要传的值分别用“,”隔开存进一个session或cookie 跳到B得时候 split 就可以了
chen_ya_ping 2009-04-21
  • 打赏
  • 举报
回复
那你写成这样看行不? document.forms[0].submit();

要是直接补行的话,就这样<body onload="submitForm()">


<script>
function submitForm() {
alert("submit");
document.forms[0].submit();
}
</script>
chen_ya_ping 2009-04-21
  • 打赏
  • 举报
回复
[Quote=引用 11 楼 C_SuperMe 的回复:]
引用 8 楼 chen_ya_ping 的回复:
不要在form标签中写onload(document.frm.submit()),,写好body标签中就可以了。
不好意思,写错了,是在body中写的,但没有效果。
[/Quote]
我是自己测试的,在我的上面是可以的。
po2600 2009-04-21
  • 打赏
  • 举报
回复
[Quote=引用 12 楼 xupeihuagudulei 的回复:]
引用 6 楼 gymzyt 的回复:
引用 1 楼 xiaofangyanan 的回复:
protected void Page_Load(object sender, EventArgs e)
{//在a里写,不知道是不是这个意思呢,是不是不显示a直接跳b呢
Response.Redirect("b.html");
}

Response.Redirect("b.aspx");
[/Quote]

参数多就把参数保存到 BEAN中``传个BEAN过去``1
C_SuperMe 2009-04-21
  • 打赏
  • 举报
回复
[Quote=引用 14 楼 xiaofangyanan 的回复:]

这样是个方法,但参数还是想post过去
是什么意思
[/Quote]要传送的参数会有很多
xiaofangyanan 2009-04-21
  • 打赏
  • 举报
回复

这样是个方法,但参数还是想post过去


是什么意思
C_SuperMe 2009-04-21
  • 打赏
  • 举报
回复
[Quote=引用 10 楼 xiaofangyanan 的回复:]
protected void Page_Load(object sender, EventArgs e)
{//在a里写,不知道是不是这个意思呢,是不是不显示a直接跳b呢
string x1="11"
string x2="22"
Response.Redirect("b.aspx?x1=&x2=");
}

[/Quote]这样是个方法,但参数还是想post过去
xupeihuagudulei 2009-04-21
  • 打赏
  • 举报
回复
[Quote=引用 6 楼 gymzyt 的回复:]
引用 1 楼 xiaofangyanan 的回复:
protected void Page_Load(object sender, EventArgs e)
{//在a里写,不知道是不是这个意思呢,是不是不显示a直接跳b呢
Response.Redirect("b.html");
}

Response.Redirect("b.aspx");
[/Quote]
C_SuperMe 2009-04-21
  • 打赏
  • 举报
回复
[Quote=引用 8 楼 chen_ya_ping 的回复:]
不要在form标签中写onload(document.frm.submit()),,写好body标签中就可以了。
[/Quote]不好意思,写错了,是在body中写的,但没有效果。
xiaofangyanan 2009-04-21
  • 打赏
  • 举报
回复
protected void Page_Load(object sender, EventArgs e)
{//在a里写,不知道是不是这个意思呢,是不是不显示a直接跳b呢
string x1="11"
string x2="22"
Response.Redirect("b.aspx?x1=&x2=");
}
C_SuperMe 2009-04-21
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 xiaofangyanan 的回复:]
protected void Page_Load(object sender, EventArgs e)
{//在a里写,不知道是不是这个意思呢,是不是不显示a直接跳b呢
Response.Redirect("b.html");
}
[/Quote]
这样是可以跳转到b.aspx,但参数不能post过来
chen_ya_ping 2009-04-21
  • 打赏
  • 举报
回复
不要在form标签中写onload(document.frm.submit()),,写好body标签中就可以了。
C_SuperMe 2009-04-21
  • 打赏
  • 举报
回复
[Quote=引用 5 楼 zyang198811 的回复:]
在a.aspx中执行onload(window.open('b.aspx'))
[/Quote]这样就没有办法传递参数了,因为form中有b.aspx需要的参数
__pass__ 2009-04-21
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 xiaofangyanan 的回复:]
protected void Page_Load(object sender, EventArgs e)
{//在a里写,不知道是不是这个意思呢,是不是不显示a直接跳b呢
Response.Redirect("b.html");
}
[/Quote]
Response.Redirect("b.aspx");
zyang198811 2009-04-21
  • 打赏
  • 举报
回复
在a.aspx中执行onload(window.open('b.aspx'))
蓝海D鱼 2009-04-21
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 xiaofangyanan 的回复:]
protected void Page_Load(object sender, EventArgs e)
{//在a里写,不知道是不是这个意思呢,是不是不显示a直接跳b呢
Response.Redirect("b.html");
}
[/Quote]up
C_SuperMe 2009-04-21
  • 打赏
  • 举报
回复
form中有一些数据是要post到b.aspx中
加载更多回复(2)

62,267

社区成员

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

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

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

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