Adds support for RedirectToAction from a DnnController #2171
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Adds RedirectToAction support in the DnnController to support the additional API. This is a small change but will have a big impact on our MVC API. We updated the DnnController to override the virtual RedirectToAction to properly use our
DnnRedirectToRouteResult
object. All the non-virtual methods rely on this.AspNetWebStack Controller class
https://github.com/aspnet/AspNetWebStack/blob/master/src/System.Web.Mvc/Controller.cs
Lines: 478-517
Looking at the Microsoft Controller implementation referenced above the all the non-virtual RedirectToAction rely on the virtual one that we now override in this change.
We also update the
DnnRedirectToRouteResult
to handle the correct Url Mapping. Consider you have 2 DNN MVC Modules on the same page, routing is handled the same way it currently does by passing in the instance of the DnnUrlHelper. This forces the page to appropriately take into account multiple MVC Modules on the current page and apply the correct ModuleId to the Url when generating it.Fixes #2170