Infinite loop when Controller-Action creates and then redirects to content with same path
I have a controller/action that creates content in the Umbraco content tree with the same path as the controller/action, but when it redirects to that content it recursively calls the action again and get stuck in an infinite loop?
Situation:
Consider a controller named DocumentType with an action named Index that takes a parameter named Id
The controller responds to the route /DocumentType/Index/1234
I have created documents in the content tree mimicing the controller's route: /DocumentType/Index/1234
The routing should navigate to the document, if it exists, otherwise it should go to the action on the controller.
The action is responsible for creating new content at the requested path and then redirect to that content
The redirection is recursively calling the action on the controller instead of serving up the content that was just created
Success:
Manually create content /DocumentType/Index/5678 in content tree
Infinite loop when Controller-Action creates and then redirects to content with same path
I have a controller/action that creates content in the Umbraco content tree with the same path as the controller/action, but when it redirects to that content it recursively calls the action again and get stuck in an infinite loop?
Situation:
Success:
Fails:
How do I tell Umbraco to serve up the newly created content rather than redirecting me back to Controller/Action?
Environment:
is working on a reply...