Posted on: 6/8/2014 9:07:31 PM | Views : 385

hello
I have an arrray of dynaic images which are pulled from a db path, based on the user's request.
However there are over 200 and random in gif, png and jpg, and its too cumbersome renaming them, so I want to check if the file exist, if not rename to the other file types 
When I run the code below in debug mode, it only loads the gif options
Kindly advise
thanks
Ehi

string serverPath = Server.MapPath("~/images/") + Path.GetFileName("~/Images/www/" + each[0].ToString() + ".png"); string imgUrl = "~/Images/www/" + each[0].ToString() + ".png"; if (!File.Exists(serverPath)) { imgUrl = "~/Images/www/" + each[0].ToString() + ".gif"; } else if (!File.Exists(Serv ...

Go to the complete details ...