I have below gridview with an imagefield linked with the UserID number. How can I do if the picture dosnt exist in the specifield older to get an standard alternate picture?
<ItemTemplate>
<asp:Image ID="MainPic" runat="server"
ImageUrl='<%# GetImageUrl(Eval("PerfilId") as string)%>' />
</ItemTemplate>
..
protected string GetImageUrl(string dbImgURL)
{
if (File.Exists(dbImgURL))
{
return dbImgURL;
}
else
{
return "AdminFotoUser/UserPics/BGP1.png";
}
}