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.
1 2 3 4 5 | 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.
1 | var pageTypes = EPiServer.DataAbstraction.PageType.List(); |