I am using WFFM Custom Save action methods. Here I am executing some service and getting response , I have to display response in next page.I used below code but its not working.
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();
}
}
You should not use a SaveAction to do the redirect to your thankyou page. You can use the Sitecore pipelines to change the redirect url. A working example can be found here for MVC forms (Webforms pipelines are mentioned as well, but without code example).