Quantcast
Channel: DevNet Questions
Viewing all articles
Browse latest Browse all 8907

Is it possible to assign the CategoryID value to CategoryInfo object?

$
0
0
I've been trying to add a new category by using the following block of code: CategoryInfo category = new CategoryInfo() { CategoryID = 999, // manually set CategoryName = "TestCategory", CategoryDisplayName = "Test Category", CategoryEnabled = true, CategorySiteID = 1 }; CategoryInfoProvider.SetCategoryInfo(category); This doesn't throw any errors but it doesn't add the new category to CMS_Category table. However, if I removed this line: CategoryID = 999,, the category gets saved into the system and the CategoryID is automatically assigned. I would like to set this field manually. Any help is appreciated. (I am trying to avoid creating additional fields to handle this)

Viewing all articles
Browse latest Browse all 8907

Trending Articles