-
-
Notifications
You must be signed in to change notification settings - Fork 768
MVC pipeline - Module control #6700
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
Open
sachatrauwaen
wants to merge
32
commits into
dnnsoftware:feature/mvc-pipeline-old
Choose a base branch
from
sachatrauwaen:ModuleControl
base: feature/mvc-pipeline-old
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
MVC pipeline - Module control #6700
sachatrauwaen
wants to merge
32
commits into
dnnsoftware:feature/mvc-pipeline-old
from
sachatrauwaen:ModuleControl
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add readme
# Conflicts: # DNN Platform/DotNetNuke.Web.MvcPipeline/Containers/SkinHelpers.Content.cs # DNN Platform/DotNetNuke.Web.MvcPipeline/ModelFactories/PageModelFactory.cs # DNN Platform/Modules/HTML/Mvc/EditHTMLControl.cs
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
MVC Module Control Implementation
Overview
The MVC Module Control implementation provides a modern alternative to DNN's traditional WebForms-based module rendering pipeline. This new system enables DNN modules to leverage ASP.NET MVC architecture while maintaining compatibility with the existing DNN framework.
Problem Statement
DNN Platform has historically relied on the WebForms pipeline accessed through
/default.aspx
. As outlined in MVC pipeline - Module Pipeline / Module rendering #6679Solution: Hybrid Pipeline Architecture
The MVC Pipeline introduces a dual-rendering mechanism:
/default.aspx
/DesktopModules/Default/Page/{tabId}/{locale}
Module Pipeline Support Matrix
Based on the GitHub issue specifications, modules can support different pipeline patterns:
Module Control Class Configuration
Modules specify their MVC compatibility through:
IMvcModuleControl
IActionable
for unified action handlingClass Diagram
Core Components
1. IMvcModuleControl Interface
The base interface that all MVC module controls must implement, extending the standard
IModuleControl
with MVC-specific rendering capabilities. This interface enables:Html()
method provides access toHtmlHelper
with information about HttpContext, controller, and page model2. DefaultMvcModuleControlBase
The abstract base class that provides common functionality for all MVC module controls:
Key Features:
3. Module Control Implementations
MvcModuleControl
The standard MVC module control for traditional MVC controllers and actions.
Features:
.mvc
control source to extract controller and action names{namespace}/{controller}/{action}
Control Source Format:
SpaModuleControl
Specialized control for Single Page Applications.
Features:
Supported Files:
.html
or custom HTML5 files.css
file inclusion (same name).js
file inclusion (same name)RazorModuleControlBase
Abstract base for modules using Razor view rendering.
This use MVC 5 razor views.
Recomended for Weforms control migrations.
Folows the ViewComponent patern of .net Core for easy future trasition to .net Core
Features:
Usage Pattern:
4. Extension Methods (MvcModuleControlExtensions)
Provides convenient extension methods for all MVC module controls:
LocalizeString()
,LocalizeSafeJsString()
EditUrl()
with various overloadsGetModuleSetting<T>()
with type conversionEditMode()
,IsEditable()
5. Resource Management
IResourcable Interface
Modules can implement this interface to automatically manage CSS and JavaScript resources.
ModuleResources System
6. Utilities
MvcModuleControlRenderer
Provides rendering capabilities for Razor-based module controls outside of the normal MVC pipeline.
MvcViewEngine
A powerful utility class for rendering MVC views to strings outside of the standard MVC request pipeline.
It runs only inside a httpcontext.
It can render a razor partial or a Html helper to a string.
It differ from the actual RazorEngine in the fact that it use mvc 5 razor syntax an can use all features of a mvc 5 partial (@model, Html helper, ...).
Core Methods:
Wrapper Implementation for WebForms
The WebForms folder includes demonstration classes that show practical implementation examples:
WrapperModule.cs
A WebForms-compatible module that bridges to the MVC pipeline, demonstrating how to integrate MVC module controls within the traditional DNN WebForms infrastructure.
Key Features:
PortalModuleBase
to maintain WebForms compatibilityMvcUtils.CreateModuleControl()
to instantiate MVC module controlsMvcViewEngine.RenderHtmlHelperToString()
usageIActionable
andIResourcable
interfaces automaticallyImplementation Pattern:
Demo Implementation
The Demo folder includes demonstration classes that show practical implementation examples:
DemoModuleControl.cs
A concrete implementation of
RazorModuleControlBase
showing how to create custom MVC module controls with dynamic view selection.Key Features:
Implementation Example:
Usage Scenarios:
IActionable
,IResourcable
)Bridge Pattern Benefits:
The WrapperModule demonstrates the bridge pattern that allows:
Remarks about db modifications
There is a sql migration scripts in this pull request created on version 10.99.00 for testing.