this is the code to read the complete path with name of all files (images) from the folder inside the project
@{ string[] imgfiles = Directory.GetFiles(@"D:\MVClearningProjects\Demo\Demo\Property_Data\Images\" + item.Property_ID, "*.*");}
this code is to load the first image to cshtml view file
<img src="@Url.Content(imgfiles[0])" alt="carousel bootstrap first" readonly style="width:200px; height:120px;" />
//not allowed local resources when I run this project usig ISS
Like the error message is telling you, you are not allowed to do that. Due to security reasons, most browsers simply will not allow the use of
file://
. You need to host it with your application and load it from the web server.Have a look at this great SO answer for an explanation and proposed solution to the problem.