Adding Template path to PageData Class


In EPiServer 6 I was able to define PageType classes and assign the template path in the same class using PageTypeBuilder.

Now in EPiserver 7 using the ContentType I can create the PageType class but i can't find a way to attach the web template path in the class definition.

How can i add the template path in code to be attached with the PageType so that i don't have to assign it manually in admin mode?

Mar 31, 2013 13:40

It's a little different depending on if you're using MVC or Web Forms. In both cases you need to inherit from the correct base page.

ASP.NET Web Forms

TemplatePage<T> and UserControlBase<T> (where T is of type PageData)



EPiServer will then automatically detect the connection between the two on start up and set the correct page/controller for that page type.

Hope this helps


Mar 31, 2013 14:22

Thanks for your repsonse.

It's ASP.Net web form .. And i already did that. I tried with and empty website with only one pagetype and one template but EPiServer didn't attach the template to the pagetype (Only detect it when i added the path in admin mode).

Mar 31, 2013 15:04

Take a look at this post for more details:

Mar 31, 2013 15:07
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* 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.