In this tutorial, you will learn how to debug a rendering issue where an Episerver property always returning null
. Even though a content editor might have added content onto a page, the page type data is never populated. Read on to learn why 🔥🔥🔥
In Episerver you define page types and blocks in code. It's easy to miss certain keywords, modifiers, and attributes when content modelling. If you are trying to run your Episerver project and no matter what you try the property is always null it is likely you missed something in code. When this happens, go to the property definition in your codebase and double-check that you have added all the required keywords. If a property is null
it is normally because you have forgotten to add the virtual
keyword:
In most cases, adding the virtual
keyword will fix the issue and when you rerun the CMS, the property will now be populated. Happy Coding 🤘