Users Pricing

forum

Home Forums Checking if file exists in asp.net mvc 4 – MindStick

Checking if file exists in asp.net mvc 4

Anonymous User 1612 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..


1 Answers

Markdown for AI

A clean, structured version of this page for AI assistants and LLMs.

Open .md