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:
Path = "/Templates/Pages/Vma/VmaTemplate.aspx")]
GUID = "340e80f7-75d6-41f3-9629-d0c1ea501164",
DisplayName = "Abc...",
Description = "Abc...",
Order = 1100,
AvailableInEditMode = true)]
public class VmaPage : BasePageData
[TemplateDescriptor(Path = "~/Templates/Pages/Vma/VmaTemplate.aspx")]
public partial class VmaTemplate : BasePage<VmaPage>
Have you published the page yet? If not, publish it and that should fix it.
Thanks for your answer!
Yes, but it doesn't help.
Should the Filename in databasetable tblContentType be set when you publish a page?
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
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.
Hmm, strange, must miss somethingThe problem is that all examples now is MVC (https://world.episerver.com/documentation/developer-guides/CMS/rendering/templatedescriptor-and-tags/)Compare it with those that works (in code) and see if you have missed something