【问题标题】:WFFM Custom Save Action :- pass response data to thankyou pageWFFM 自定义保存操作:- 将响应数据传递到感谢页面
【发布时间】:2016-12-19 14:39:06
【问题描述】:

我正在使用 WFFM 自定义保存操作方法。在这里我正在执行一些服务并获得响应,我必须在下一页显示响应。我使用了下面的代码,但它不起作用。

internal class WffmCustomSaveAction : WffmSaveAction
{
    public override void Execute(ID formId, AdaptedResultList adaptedFields, ActionCallContext actionCallContext, params object[] data)
    {
        HttpContext.Current.Response.Clear();

        StringBuilder sb = new StringBuilder();
        sb.Append("<html>");
        sb.AppendFormat(@"<body onload='document.forms[""form""].submit()'>");
        sb.AppendFormat("<form name='form' action='{0}' method='post'>", "http://local.website/thankyoupage");
        sb.AppendFormat("<input type='hidden' name='id' value='{0}'>", "id123");
        // Other params go here
        sb.Append("</form>");
        sb.Append("</body>");
        sb.Append("</html>");

        HttpContext.Current.Server.Transfer(sb.ToString());
        HttpContext.Current.Response.End();
    }
}

【问题讨论】:

    标签: sitecore web-forms-for-marketers


    【解决方案1】:

    您不应使用 SaveAction 重定向到您的感谢页面。您可以使用 Sitecore 管道更改重定向 URL。可以在 here 找到 MVC 表单的工作示例(也提到了 Webforms 管道,但没有代码示例)。

    一切都归结为找到正确的管道 网站核心。在这种情况下,您需要一个管道以防成功。但请注意:webforms 和 mvc 解决方案之间存在很大差异。

    Webforms:Webforms 的管道是:&lt;successAction&gt; 这可以在Sitecore.Forms.config 中找到。

    mvc:mvc情况下的管道为:&lt;wffm.success&gt; 这可以在Sitecore.MvcForms.config 中找到。

    【讨论】:

      猜你喜欢
      • 2023-04-05
      • 1970-01-01
      • 2014-09-26
      • 1970-01-01
      • 2015-01-17
      • 2015-12-19
      • 1970-01-01
      • 1970-01-01
      • 2011-03-05
      相关资源
      最近更新 更多