Quantcast
Channel: Using Optimizely Platforms
Viewing all articles
Browse latest Browse all 8020

Using a SelectionFactory with ConentReference property issue

$
0
0

I am attempting to use a selection factory to make choosing a specific kind of content type simpler. I am using a variation of this type of selection factory to list my content in a dropdown:
https://github.com/alfnilsson/episerverutils/blob/master/SelectContent/ContentSelectionFactory.cs

The problem is the property I am using the factory on will not serialize the selected value into a ContentReference properly. I get an error "Unable to cast object of type 'System.String' to type 'EPiServer.Core.ContentReference'" when saving the item. It works fine if I change the property to a string though, but it forces me to parse it into a ContentReference manually if I want to use it in code. 


Viewing all articles
Browse latest Browse all 8020

Trending Articles