Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds support for RedirectToAction from a DnnController #2171

Merged
merged 1 commit into from
Jul 18, 2018

Conversation

SkyeHoefling
Copy link
Contributor

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

@dnfclas
Copy link

dnfclas commented Jul 18, 2018

CLA assistant check
All CLA requirements met.

Copy link
Contributor

@mitchelsellers mitchelsellers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change looks great to me! Anything to get feature parity to the MVC way of doing things is a great improvement!

@ohine ohine added the Community Legacy label used to identify community contributions label Jul 18, 2018
@ohine ohine added this to the 9.2.2 milestone Jul 18, 2018
@ohine ohine merged commit 400727f into dnnsoftware:development Jul 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Community Legacy label used to identify community contributions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants