In my last post, What Is An Umbraco Macro I discussed the benefits and usages of macros. If you have worked on a bog standard MVC site at all, you should be used to working with partial view. Partial views are the MVC ways to create re-usable components within your project. In today's guide, I'm going to cover a simple pattern that will allow content editors to be able to drop MVC partials into the website.
var partialView = (string)Model.MacroParameters["partialView"];
if (partialView == "PartialViewExample")
var partialViewExample = new JonDJones.BusinessLayer.ViewModel.PartialViewExample();
Software Architect, Programmer and Technologist Jon Jones is founder and CEO of London-based tech firm Digital Prompt. He has been working in the field for nearly a decade, specializing in new technologies and technical solution research in the web business. A passionate blogger by heart , speaker & consultant from England.. always on the hunt for the next challenge