To get all page types in Episerver, use the following code
For older versions of Episerver if the above code doesn't work, use the following code.
Note: This function has been obsolete in latest versions of Episerver, but still works.
using EPiServer.ServiceLocation; using EPiServer.DataAbstraction; var repository = ServiceLocator.Current.GetInstance<PageTypeRepository>(); var pageTypes = repository.List();
For older versions of Episerver if the above code doesn't work, use the following code.
Note: This function has been obsolete in latest versions of Episerver, but still works.
var pageTypes = EPiServer.DataAbstraction.PageType.List();
Thanks :)
ReplyDelete