XForms: Redirecting after submitted data

Vote:
 
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 :/
#13275
Mar 25, 2008 18:35
Vote:
 
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); } } }
#15562
Mar 25, 2008 18:47
Vote:
 
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="http://schemas.microsoft.com/intellisense/ie5" %> <%@ Register TagPrefix="EPiServer" Namespace="EPiServer.WebControls" Assembly="EPiServer" %> <%@ Register TagPrefix="XForms" Namespace="EPiServer.XForms.WebControls" Assembly="EPiServer.XForms" %>


#15563
Mar 25, 2008 18:47
* 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.