Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hello Umbraco Colleagues,
I'm using v. 6.0.5 and I'd like to use BOTH Web Forms and Razor in the same Umbraco instance.
I use Razor mostly - but have a few legacy Web Forms templates that I'd like to use side-by-side with razor.
I do not intend to have use the same docTypes/Content nodes - some docTypes would use Web Forms templates - other docTypes would use Razor.
Is this possible?
(Web forms templates don't show up in the template list if defaultRenderingEngine=Mvc.)
Any help would be appreciated. Thanks,
The way to do this is to actually leave the renderengine at Webforms and then create Razor Views in /Views with the exact same filename name as your masterpages file (of course change .master to .cshtml). Umbraco will pick the .cshtml first and use mvc to render it.
I've been wondering this too. It would be great if /Views could be edited though the Settings section, just like master pages.
Thanks much, Seb.This got me doing a tiny bit of experimentation.Here are a few things I've discovered that appear to be true (please chime in if I got something wrong):The "defaultRenderingEngine" setting in umbracoSettings.config determines where new templates are created.You can change this as needed (remember to touch Web.config to get the changes to take effect)."WebForms" causes templates to be created in the /masterpages folder, "Mvc" in the /Views folder.If "defaultRenderingEngine" setting in umbracoSettings.config is "Mvc", then BOTH .master and .cshtml files will appear as templates in the Settings section.They have different icons according to which type they are.This way, just as Funka! desires, Webforms and Mvc templates can be edited though the Settings section.If you have two files of the same name (one .cshtml in /Views, another .master in /masterpages), the .cshtml will be rendered regardless of which defaultRenderingEngine is used.Warning - if you try and edit one (defaultRenderingEngine setting determines which), the other one will be deleted.Hope this helps someone.DfH
David and Sebastiaan, this is good to know. I always thought it was too bad that Templates (in the settings section) couldn't have been left alone and kept for webforms master pages, and a new Views added alongside this.
Although the workaround mentioned here is promising in that it certainly will "work", it seems like it would be a lot nicer to have this natively supported in the admin UI without any dangers of deleting anything or requiring Visual Studio (or any other external editor I suppose) to make this work.
Thanks for your research on this!
Thank you David! I'm new to Umbraco and your aside to "touch the web.config" was the answer to 2 hours of puzzling over why my back office was still churning out masterpages.
Cheers David. I still find it faster to work the oldschool way, so the ability to generate more masterpages after setting the site to mvc is a godsend.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted