Try our conversational search powered by Generative AI!

XForms: Redirecting after submitted data

Hi Fellow episervians I've implementet the XFormControl on a page, but the xform does not redirect to another page, after the data has been submitted. How do i get the url that the user had specified in the xform editor, so i can redirect on the AfterSubmitPostedData event? thanks in advance. /Martin Heres how i've implemented the XFormControl. (special surcumstances dictates that i have to do everything on the markup page :/
Nov 16, 2007 14:17
You need do hook into the AfterSubmitPostedDataEvent, similar to this: //In your OnInit method FormControl.AfterSubmitPostedData += new SaveFormDataEventHandler(FormControl_AfterSubmitPostedData); // Your event method could look something like this public void FormControl_AfterSubmitPostedData(object sender, SaveFormDataEventArgs e) { if (FormControl.FormDefinition.IsSent) { if (FormControl.FormDefinition.PageAfterPost != 0) { PageData pd = GetPage(new PageReference(FormControl.FormDefinition.PageAfterPost)); Page.Response.Redirect(pd.LinkURL); } } }
Nov 16, 2007 15:59
Thank you Mari - it works. For all peps that has this problem in the future, here is what my code looks like: (XForm.ascx) <%@ Control Language="c#" AutoEventWireup="false" Codebehind="XForm.ascx.cs" Inherits="development.Templates.Units.XForm" TargetSchema="" %> <%@ Register TagPrefix="EPiServer" Namespace="EPiServer.WebControls" Assembly="EPiServer" %> <%@ Register TagPrefix="XForms" Namespace="EPiServer.XForms.WebControls" Assembly="EPiServer.XForms" %>

Nov 16, 2007 16:28
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.