Programmaticaly deleting a media in "media picker"
I’ve working with a Member Type which has a property of type “media picker”.
Using the API, I’m trying to delete the media. It’s working for the media node (moved to the recycle bin). However, I cannot find how to update the property of the member. How do I programmatically delete a value in a media picker property ?
Programmaticaly deleting a media in "media picker"
I’ve working with a Member Type which has a property of type “media picker”.
Using the API, I’m trying to delete the media. It’s working for the media node (moved to the recycle bin). However, I cannot find how to update the property of the member. How do I programmatically delete a value in a media picker property ?
Thank you,
Hi You need to assign a null value to the property then the reference is deleted.
Cheers,
Richard
Yes, it's working now. Thank you, Richard.
I tried the following -
It throws an error. How do I set it to null value ?
string tj = ProgramNode.GetProperty("programPhoto").ToString();
Media thisMedia = new Media(Convert.ToInt32(tj));
thisMedia.delete(true);
ProgramNode.GetProperty("programPhoto").Value = String.Empty();
is working on a reply...