F
Filip De Backer
Hi,
I know that the File object doens't work in asp.net, but how can I check if a file MyDog.jpg exists before I link it to the Image object in my web aplication.
I want to show NoPicture.jpg when the file doesn't exist.
I want to change the code to something I can use but I don't know what :
strFileName = "MyDog.jpg";
if (System.IO.File.Exists(strFileName))
{
imgPicture1.ImageUrl = strFileName;
}
else
{
imgPicture1.ImageUrl = "NoPicture.jpg";
}
thanks a lot
Filip
I know that the File object doens't work in asp.net, but how can I check if a file MyDog.jpg exists before I link it to the Image object in my web aplication.
I want to show NoPicture.jpg when the file doesn't exist.
I want to change the code to something I can use but I don't know what :
strFileName = "MyDog.jpg";
if (System.IO.File.Exists(strFileName))
{
imgPicture1.ImageUrl = strFileName;
}
else
{
imgPicture1.ImageUrl = "NoPicture.jpg";
}
thanks a lot
Filip