如何在发送表单后重定向用户?

时间:2015-02-20 12:18:22

标签: asp.net-mvc-4

        System.Web.HttpContext.Current.Response.Clear();

        System.Web.HttpContext.Current.Response.Write("<html><head>");
        System.Web.HttpContext.Current.Response.Write(string.Format("</head><body onload=\"document.{0}.submit()\">", "pay"));
        System.Web.HttpContext.Current.Response.Write(string.Format("</head><body>"));
        System.Web.HttpContext.Current.Response.Write(string.Format("<form name=\"{0}\" method=\"{1}\" action=\"{2}\" >", "pay", "post", payURL));
        System.Web.HttpContext.Current.Response.Write(string.Format("<input name=\"MERCHANT\" type=\"hidden\" value=\"{0}\">", merchant));
        System.Web.HttpContext.Current.Response.Write("</form>");
        System.Web.HttpContext.Current.Response.Write("</body></html>");
              System.Web.HttpContext.Current.Response.End();

用户发送表单,我想要从payURL重定向用户

1 个答案:

答案 0 :(得分:0)

您是否尝试过Response.Redirect("Redirectpage.aspx");