Hi
If you look in the XForm.ascx in the sample template package ( the control can be found in the folder /Templates/Public/Units/Placeable ) you can find an example on how it can be done.
Basically what you do is to attach to the AfterSubmitPostedData event of your XFormControl. There you can just do a redirect to the PageReference found in FormDefinition.PageAfterPost in your XFormControl.
Hi
Thanks for the reply. I tried it. But its not able to find the XForm from the page, thereby no form is displayed.
The code is as follows:
<XForms:XFormControl id="FormControl" runat="server" EnableClientScript = "true"/>
Code Behind:
protected override void OnInit(EventArgs e){
base.OnInit(e);
Form.PageId = CurrentPage.Pagelink.Id;
FormControl.FormDefinition =Form;
FormControl.AfterSubmitPostedData + = new SaveFormDataEventHandler(FormControl_AfterSubmitPostedData);
}
Hi!
The code in the public templates defines the name of the xform property in the page markup while defining the xform.ascx control. Make sure that you have this defined or change the logic in your ascx file so that you define the name of your xform property.
Regarding the redirect to another page after successfully posting the form this is built in functionality in EPiServer. Just define the page after post when editing the post. The actual redirect in done in the code behind of the xform user control by attaching to the AfterSubmitPostedData event.
Regards
Linus Ekström
EPiServer Development Team
Hi,
I have an XForm. After the Submit click of Xform the mpage must be redirected to another page. This must be handled from code behind.
I used EPiServer.XForms.WebControls.Submit.SEND_TO_CUSTOM_URL. But still the page is not getting redirected. Can someone suggest the code.
Regards,
Reena