I have a arrav string like this:
string[] imgList = new[] { "/Images/10000489Back20130827.jpg", "/Images/2F.jpg", "/Images/10000489Front20130827.jpg" };
that contain names of file, contained in an virtaul directory.
If this parameteres I assigned to an ImageUrl, the image is displayed. In the detail of the pages show the propertie like this:
src="/Images/1F.jpg"
But when I try to looking for the files in specific directory all the files and assigned to an ImageUrl rpoperties, the images it's not displayed. I note that the path retrieve complete, and not a reference of the virtaul directory
string path = "/Images"; ///Obtener el path virtual
DirectoryInfo directory = new DirectoryInfo(path);
FileInfo[] files = directory.GetFiles("*.jpg");
imgList = files.Where(x => x.FullName.Contains(clientNumber)).Select(x => x.FullName).ToList().ToArray();
I retrieve this path:
src="C:/Images/1F.jpg"
How can I get only the virtual path with the name of the file using DirectoryInfo class?
try this: