Quantcast
Channel: Developer to developer
Viewing all articles
Browse latest Browse all 9076

Is this add category programmatically function a bug?

$
0
0

I've noticed that when adding categories to a page programmatically like this, Episerver doesn't save any categories.

newsPage.Property.Set("PageCategory", new PropertyCategory());
newsPage.Category = new CategoryList(new int[] { 2, 3, 4 });

But if I save categories like this Episerver succeeds in saving the categories

newsPage.Property.Set("PageCategory", new PropertyCategory());
newsPage.Category = new CategoryList();
newsPage.Category.Add(2);
newsPage.Category.Add(3);
newsPage.Category.Add(4);

Would be great if someone could verify or not verify that it actually is like this.


Viewing all articles
Browse latest Browse all 9076

Trending Articles