Hi,
I have this scenario to implement: a collection of parentEntities, each parentEntity having zero to childEntities. I need to implement a multiple-delete form (checked parentEntities will be deleted), with this rule: if a parentEntity has children, it can be deleted only after all its children have been linked to other parentEntities.
So I have the Index form for the parents, and on submit I post to the "Delete" action. For each checked parent, if it has zero children I delete it, else I redirect to children edit view. When there is no more child linked to the initial parent, I must return to the parents "Delete" action and continue from where I left (delete the current parent whose children I just re-affected, then delete the next checked parent).
My problem is: HOW do I write the return from children edit to the parents delete?
I use:
return new RedirectToRouteResult(new RouteValueDictionary(new { controller = "Parents", action = "Index", page, IDsToDelete = idCollection }));
but I get the error:
http://localhost:64209/Parents/Delete?page=0; The resource cannot be found.
Thank you for helping. Manu