Try our conversational search powered by Generative AI!

Listing Categories on Page


I'm building a website that will have a FAQ section.

On the FAQ page i'ld like to list all subcategories to Category named "FAQ".  Clicking on a tag will then filter the faq items with ajax (I'll figure out this later)

How do I get a list av subcategories and write out them in a view in EPiServer 7 MVC Razor?


Thanks in advance.


Aug 27, 2013 16:55

This should give you all child categories (if any) for paritcular assign category for the page.

Category c = Category.Find(CurrentPage.Category.First());
CategoryCollection allChildCategories = c.Categories;


What you do with CategoryCollection and how you move that to ViewModel is up to you - either you access this from view itself, add it to viewmodel as collection of categories or map to some more abstract-not-related-to-EPiServer-collection and then process and render that on the view. It depends on your overall MVC app structure and approach.

Aug 27, 2013 17:55

Thanks Valdis!

Aug 28, 2013 8:41

Hi All, 

I am new to episerver Cms.

I need to list the sub catagories also ? 

Can anybody help me

Dec 08, 2015 14:06
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.