SaaS CMS has officially launched! Learn more now.

Page with new page type from code can not be displayed



I use EpiServer CMS version 10 and Web Forms.

I have created a page type in my code and I also have created a page for this page type.

When I start my webapplication EpiServer finds my new page type and I can see it in the CMS admin mode.

But when I create a new page with this page type I get an ArgumentNullException when I try to display it.

This line returns null.


Episerver's databas table tblContentType has null in column Filename for my new page type. Other pages that work, seems to have a filename here and if I set this value manually it works fine. Shouldn't that value be set when Episerver scans for new page types?

My code looks like this:

namespace Portal.Epi.Structure.PageTypes.Vma
        Path = "/Templates/Pages/Vma/VmaTemplate.aspx")]
        GUID = "340e80f7-75d6-41f3-9629-d0c1ea501164",
        DisplayName = "Abc...",
        Description = "Abc...",
        Order = 1100,
        AvailableInEditMode = true)]
    public class VmaPage : BasePageData

namespace Portal.Epi.Templates.Pages.Vma
    [TemplateDescriptor(Path = "~/Templates/Pages/Vma/VmaTemplate.aspx")]
    public partial class VmaTemplate : BasePage<VmaPage>


Feb 10, 2020 16:35

Have you published the page yet? If not, publish it and that should fix it. 

Feb 10, 2020 16:42

Thanks for your answer!

Yes, but it doesn't help.

Should the Filename in databasetable tblContentType be set when you publish a page?

Edited, Feb 10, 2020 16:54

The filename in tblcontenttype should/might be set when Episerver discover that you have created or updated a new content type not when publishing a page.

Regarding that GetUrl is returning null it feels more like that the content is not related to any view engine but in your code it looks like it should have.

Try go to admin and into the content type and reset it to default so it is not problem with someone made changes in admin that is overriding your code

Feb 11, 2020 7:18

Thanks, Henrik!

I run this on my own local environment, so no one else has access to it.

But I did try to reset it to default, but  same result.

Feb 11, 2020 8:02

Hmm, strange, must miss something
The problem is that all examples now is MVC (

Compare it with those that works (in code) and see if you have missed something

Feb 11, 2020 8:15
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.