AI OnAI Off
I have found out that RedirectToContent works but I also need to send paramter(s) and it doesn't have any overload that takes route values ->
return RedirectToContent(currentPage.PageLink, "PersonalInformation");
Ok. I found out that Redirect method which only takes URL as paramter is working
e.g. ->
return Redirect($"{currentPage.ContentLink.GetFriendlyUrl()}PersonalInformation/?indmeldelseId={regId}");
but this a primitive way of doing and it also requires manally building URL with all the paramters. Does anyone know why is it not possible to use RedirectToAction()
like this ->
return RedirectToAction("PersonalInformation",
new
{
id = registrationUpdated.Id,
});
We are in process of upgrading EpiServer 11 to Optimizely ver. 12. In this process we have enountered this isse that when redirection from one action method to another the route can't be found and the exception is thrown.
The "RedirectToAction" method is throwing an error
An unhandled exception occurred while processing the request.
Microsoft.AspNetCore.Mvc.Infrastructure.RedirectToActionResultExecutor.ExecuteAsync(ActionContext context, RedirectToActionResult result)
I have also tried to change the name of "PersonalInformation" action method to something different but still got the same error. I even tried to send currentPage as route values but it didn't work