Try our conversational search powered by Generative AI!

XForm saving data but not redirecting

Vote:
 

I have searched the topic here and a few relate but no answers have fixed my issue. I have a basic form which has a page set to redirect to after submit and it does not kick off the AfterSubmitPostedData (which is attached in the global.asax.cs file) when the form is submitted. It saves the data to the database but refuses to redirect. The default handlers in global.asax should work but I have also tried to attach directly in the control but with no success. Is there something obvious I should look at?

 

Cheers

#38580
Apr 13, 2010 19:54
Vote:
 

Try setting a break point inside the XForm_AfterSubmitPostedData method and debug to see what happens.

The code that does the redirect looks something like this.

if (control.FormDefinition.PageGuidAfterPost != Guid.Empty)
{
	PermanentPageLinkMap pageMap = PermanentLinkMapStore.Find(control.FormDefinition.PageGuidAfterPost) as PermanentPageLinkMap;
	if (pageMap != null)
	{
		control.Page.Response.Redirect(pageMap.MappedUrl.ToString());
		return;
	}
}

Frederik

#38581
Apr 13, 2010 20:10
Vote:
 

You might have seen this in other topics while searching for an answer, but in case not...: I had problems before with getting the AfterSubmitPostedData event to my event handler when a page after post was set. I was able to get it working by moving the event registration (which was in OnLoad) to OnInit. I interpret it that as the redirect was being performed in such a way that the event chain was interrupted before reaching my event handler. By registering the handler earlier it would end up being called before whatever-it-was happened that prevented it from being called. But if you don't even get redirected that might not be the problem at all.

#38583
Apr 14, 2010 5:38
Vote:
 

I have put  breakpoint on the global AfterSubmitPostedData in the global asax.cs file but it doesnt enter it. The XForm_ControlSetup and XForm_BeforeLoadingForm methods get called but nothing else. Are you suggesting that I create my own handler and attach it in the OnInit of the control instead? As I said - the form works fine as far as saving the data goes and just doesnt redirect. The form is on a complex page though so it could be something mucking about with the chain of control after the post.

#38586
Apr 14, 2010 8:58
Vote:
 

I misinterpreted your question, sorry. See if you can get the form to work as expected if used on a simpler page type?

#38591
Apr 14, 2010 11:59
Vote:
 

Did you solve this?
I have the exact same problem.

 

 

#47733
Feb 10, 2011 16:52
Vote:
 

Got the same problem!

#58035
Apr 11, 2012 14:01
* 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.