不同站点之间的跳转

renylsunt 2005-12-02 10:16:25
用window.open打开一新窗体(新窗体位于另一个站点之下)的同时,将部分参数用post方式传至新窗体(不能用get方式,即不能在url中进行参数传递)
对于以上需求(C#),请各位支招,谢谢!
...全文
104 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
ZetaChow晓代码 2005-12-02
  • 打赏
  • 举报
回复
打开新窗口的body 的ONLOAD事件中 提交FROM就可以了,然后再由FROM去获得提交到的页面,注意打开方式
supesa 2005-12-02
  • 打赏
  • 举报
回复
script激发post,可以用
function __doPostBack_Ex(eventTarget, eventArgument)
{
var theform;
if (window.navigator.appName.toLowerCase().indexOf("netscape") > -1)
{
theform = window.Form1;
}
else
{
theform = window.Form1;
}
if(!theform.__EVENTTARGET)
{
theform.appendChild(window.document.createElement("<input type='hidden' name='__EVENTTARGET'>"));
}

if(!theform.__EVENTARGUMENT)
{
theform.appendChild(window.document.createElement("<input type='hidden' name='__EVENTARGUMENT'>"));
}

theform.__EVENTTARGET.value = eventTarget.split("$").join(":");
theform.__EVENTARGUMENT.value = eventArgument;
if ((typeof(theform.onsubmit) == "function") && theform.onsubmit()!=false)
{
theform.submit();
}
else
{
theform.submit();
}
}
function __doPostBack(eventTarget, eventArgument)
{
__doPostBack_Ex(eventTarget, eventArgument);
}
调用__doPostBack('','');
supesa 2005-12-02
  • 打赏
  • 举报
回复
<form id="Form1" method="post" runat="server" action=report.aspx> </form>
action=指向要跳转的文件
shrinerain 2005-12-02
  • 打赏
  • 举报
回复
新窗口中有一个form,把要传的值input type="hidden" 写好,action对应要提交的页面。
onload里面form.submit就行了。

110,537

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

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