London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!

Adding Template path to PageData Class

Vote:
 

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?

#69619
Mar 31, 2013 13:40
Vote:
 

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)

ASP.NET MVC

PageControllerBase<T>

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

Frederik

#69620
Mar 31, 2013 14:22
Vote:
 

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).

#69623
Mar 31, 2013 15:04
Vote:
 

Take a look at this post for more details: http://world.episerver.com/Blogs/Johan-Bjornfot/Dates1/2012/9/EPiServer-7--Rendering-of-content/

#69624
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.