I'm trying to use multiple folders for my views in a custom MVC module for DNN. The goal is to choose a theme in the module settings and then depending on the setting use a different view folder (i.e. use different cshtml files for the actions). Is there a way to tell razor that it should look up other locations first? (Can I use the ViewLocationExpander in DNN for my module?) Thanks!
Is there a way to tell Razor (DNN's View Engine) to use a different Views Folder for a MVC Module?
155 Views Asked by Niels Mittelstädt At
1
There are 1 best solutions below
Related Questions in RAZOR
- Getting and passing MVC Model data to AngularJS controller
- Implement Onfailure in webApi controller
- Dynamic roles list in CustomAuthorize ASP MVC
- Jquery: Change contents of <select> tag dynamically
- Submit Button on Razor View doesn't call Action Result - MVC
- ASP MVC 5 Html.EditorFor not working / Unable to access/use Default Editor Templates
- Convert string to date time in a `cshtml` file using razor?
- jQuery: How to traverse / Iterate over a list of object
- Switching CSS Just for that view?
- Hyperlink in table header is not rendering
- why Special characters apostrophe and others shows like this ’, in HTMl file
- Display a tooltip with Html helper
- Cannot access conditional Razor variable as href
- MVC How to bundle html templates of type "text/html"?
- Set a label value for a checkbox helper in asp.net mvc
Related Questions in RAZORENGINE
- List of alphabet sort to display vertically
- How to send selected radiobutton value together with html.actionlink in MVC 5
- Conditionally apply styling to a table in an MVC Razor view
- How to make label for radio button
- How to parse a PartialView and return a Html string from ApiController?
- ASP Net Core View Location issue
- RazorEngine.Templating.TemplateCompilationException
- How to make intellisense works with RazorEngine?
- How to reuse model and view for Add and Edit in the administration MVC 4 app
- RazorEngine - @Html.LabelFor OK, @Html.EditorFor "not implemented exception" on Execute()
- Calling RazorEngine.Parse() in Controller Action fails with bad HttpContextBase
- How do I get the RazorEngine Parse method to work successfully with the layout?
- Issue with cyrillic characters in razor engine
- Html.Partial string combine for view file name
- Issue with RazorEngine, Templates and email addresses
Related Questions in DNN9
- DNN Search Module
- How to manipulate 2sxc/dnn search result titles?
- How to access 2sxc API from external non DNN website
- Which version of 2sxc content module is stable and has correct references in source code, so that it can be deployed and launched locally?
- How can I use RelationshipFilter in 2sxc Visual Query with text field instead of entity field?
- Can't Save SQL Query in 2sxc SQL DataSource
- DNN Upgrade Stalls 9.10.2 to 9.13
- 2sxc View Does Not Have App Context When Rendered From Another App's View
- How can I get a 2sxc Toolbar Button added that is a link to another page and does NOT open in a new tab/window?
- Issue After Dnn Upgrade rollback
- How to add an extra view to my DNN module?
- Getting values from SQL table in Evoq (DotNetNuke), DNN custom Module
- How to add the DNN Event Logger Depedency Provider to a custom Controller Class that Inherits the DNNAPIController Class?
- How to add the new Event Logger to a DNN Scheduler Class in DNN 9.10.2?
- DNN: Resolve IPortalInfo service
Related Questions in DOTNETNUKE
- Getting errors while building DNN Code in VS 2010
- DNN - How to Transfer Production Version Code in Local with enabling debug
- DNN Can`t add reference
- How to use different css for different languages in dnn?
- dotnetnuke localresourcefile does not return resource file name for dynamically loaded control
- Moving strings and triggering events with jquery
- Error after upgrading from DNN 7.0 to 7.4.1 (Version Upgrade package)
- Can we create a child with name child.parent using DNN community edition?
- OnEntryAdded doesn't fire in RadDropDownTree When I Change the Value of the DropDownTree
- DNN - dnn.js reference duplicated when ClientResourceManagement is enabled
- DNN 7.4 friendly URL (gclid)
- dnn how to uniquely identify instances of the same module
- DNN - Redirecting to installation wizard
- IIS Redirects me to another URL
- DNN (DotNetNuke) module exceptions not logging
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
I understand that you want to have some kind of App settings and have MVC use the setting to select the View for you. I believe that is possible, but there is a simpler, lower-tech way to do it if using @RenderPage() or @RenderPartial() make sense for what you are trying to do.
So imagine you start in
_index.cshtmlYou could either have your files in folders and construct the path (imagine the setting is something like Path = "live" or "staging"):
Or directly modify the filename instead