I want to check to see whether a certain category exists for a page. I have pagedata and from that i can access category, right?
But how do i loop through the categories for that page to see if anyone matches the category i look for?
I'm looking for a category called "fish" now i have page A and want to find out if page A has the category fish added to it.
Hi,Try this (page is a PageData object)
var category = Category.Find("fish");
if (category != null)
bool isOfCat = page.Category.MemberOf(category.ID);
Thanks, worked perfectly!
If any one else should find this useful:Just remember to add a reference to EpiServer.DataAbstraction namespace :-)