Users Pricing

forum

home / developersection / forums / checking if file exists in asp.net mvc 4

Checking if file exists in asp.net mvc 4

Anonymous User 1485 15 Mar 2018

I want to check the existence of image ... how to do this can anyone help me..

 @if (Server.MapPath("~/Content/Images/UserImage/" +Model.ID + ".png"))

                {
                    <img src="~/Content/Images/UserImage/" + @Model.ID + ".png" alt="@Model.FirstName">
                }

Thanks..


I am a content writter !


1 Answers