当前位置:编程学习 > C#/ASP.NET >>

求助一下,页面跳转

<body>

<%
    if (Res["Result"].ToString().Equals("0"))
    {
%>
<form name='ReadyForm' action='http://web.telepay.com.tw/Telepay/Start.php3' method='post'>
            <%= tlib.MakeFormInput(Res, "|Result|ReasonCode|ReasonText|ReasonTextCharset|ReasonTextLang|")%>
            <%= tlib.MakeFormInput(Disp, "")%>
</form>

<SCRIPT LANGUAGE="JavaScript">
    document.ReadyForm.submit();
</SCRIPT>
<%
    }
    else
    {
        SetErrorPage();
%>
        <UC:Error ID="Error" runat="server"/>
<%
    }
%>
</body>

上面这段代码 主要是前台Post页面跳转,我想要把他移到后台来做post跳转。
或则可以在后台执行完以后可以可以执行前台的Post跳转。 --------------------编程问答-------------------- 后台跳转用Response.Redirect()就可以了啊。 --------------------编程问答-------------------- 或者这个也可以
Server.Transfer(urlPath);
--------------------编程问答-------------------- Response.Redirect()试过了,不行。 --------------------编程问答-------------------- Server.Transfer(urlPath);不行,因为那个跳转界面是第三方的。 --------------------编程问答-------------------- 有个恶搞的方法!!!
ScriptManager.RegisterStartupScript(this, GetType(), "", "document.ReadyForm.submit();
", true);
--------------------编程问答--------------------
引用 5 楼 guduheshao168 的回复:
有个恶搞的方法!!!
ScriptManager.RegisterStartupScript(this, GetType(), "", "document.ReadyForm.submit();
", true);


这个是不是js调用前台的代码,好像js代码调用前台不能执行.net代码 --------------------编程问答-------------------- ScriptManager是后台的一个类。
比如你有个button事件
事件里写
{
   //判断是否提交
    if(能提交)
       ScriptManager.RegisterStartupScript(this, GetType(), "", "document.ReadyForm.submit();
", true);
    else
   return;
}

这不就是你想要的东西吗!!!!
补充:.NET技术 ,  ASP.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,