I am using visual studio 2012, C#/net 4.5, Umbraco 7.1.4.
Got an issue with the media folder.
I deleted the images and folders in the media folder via the CMS.
However when I did this the content pages were still attempting to find and use these images.
So I removed any links from all the media pickers.
Still had the issue, so I checked my code, and its still looking for the file.
So this time i looked around and removed from the Recycle bin. Still trying to find the ID.
So then i looked through the Folder itself on window explorer, files were all there.....strange. so i deleted all of them. Guess what? still trying to search for the media. i checked my solution explorer, Yeh you guessed it there still in there! so i deleted it from there too.
So, deleted all media files, deleted all references, deleted all images in folders.
there should be no references, no images.
but guess what, I step through the following code, and somewhere in Umbraco it still has the ID of the images.
@if (Model.Content.GetPropertyValue("logo") != null)
{
var mediaItem = Umbraco.TypedMedia(Model.Content.GetPropertyValue("logo", true));
<img class="img-logo" src="@mediaItem.GetPropertyValue("umbracoFile")" width="100" height="50" alt=""/>
}
Can someone please tell me what is going on?
Additional information:
I published my website and ftped it over to my dev server, the DB did not move as my local copy and the dev copy now point to the same DB. This was a test to see if the publish would work.
when I used the site though none of the images where showing, although the images were there in the folders. I looked around and found it weird. So i decided to remove all images and references, 1st I deleted all folders in the cms. then I removed all references from the content. The rest as I said is all explained, no matter what I do its still trying to find these damn Images.
Any help would be amazing as I'm completely stuck.
Also: should mention that
@if (Model.Content.GetPropertyValue("logo") != null)
was originally
@if (Model.Content.HasValue("logo"))