Unable to cast object of type 'EPiServer.Url' to type 'System.String'.


Hi everyone

I'm trying to add an image property to a pagetype in cms7 but I keep getting the error above. 


This is how I've added it to the pagetype:


Name = "Image",
Description = "Image",
Order = 3)]
public virtual string ImageUrl { get; set; }


But all I get is Unable to cast object of type 'EPiServer.Url' to type 'System.String'.   when I try to choose an image. 


Anyone that know what might be wrong?

Nov 14, 2012 15:14

Change the type of your property from string to EPiServer.Url

Nov 14, 2012 15:18

Thanx Johan


But everywhere I look, people have used string. How's this possible?

Nov 14, 2012 15:26

This has changed in the release of EPiServer 7

Nov 14, 2012 16:03

aha, fair enough :)

Nov 14, 2012 16:04
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.