That sort of makes sense although i dont of the top of my head know what is happening under the covers.
Delete is removing the piece of media, therefore when you try to instance it, its returning null
MoveToRecycleBin() is moving the media to the recycle bin and therefore when you try to instance it it is being returned as an object of type Media / IMedia (what ever the type is). If you inspect the object. I think it has a property of IsTrashed something like that that will be set to true :).
Delete(media) Vs MoveToRecycleBin(media)
when i use
it seems like ok, but you will get error here :
the error is "Object reference not set to an instance of an object."
but when you add this line it will not get any errors
but if i use MoveToRecycleBin() instead of Delete(), here we no need to use refreshContent(), will not get any errors.
so the Delete(media) should use refrechContent(), but MoveToRecycleBin(media) no need to use refrechContent().
for a good performance:
- which one is better to delete image.
- and should i use refreshContent() when updating content
thanx
Hi Khaled,
Try to use something like that:
"" - is empty string value.
Thanks
Kahled,
That sort of makes sense although i dont of the top of my head know what is happening under the covers.
Delete is removing the piece of media, therefore when you try to instance it, its returning null
MoveToRecycleBin() is moving the media to the recycle bin and therefore when you try to instance it it is being returned as an object of type Media / IMedia (what ever the type is). If you inspect the object. I think it has a property of IsTrashed something like that that will be set to true :).
Thanks,
Charlie.
is working on a reply...