I am creating a web site with ASP.NET Web pages. I need to set path for html img tag dynamically. I searched everywhere they have given reasonable answeres but still they didnt work for me.
Image file path - root/Images/11.jpg
My code in Upload.cshtml
@{
var fileName = "11.jpg";
var path = "Images/" + fileName;
<img src="@path" alt="image" />
}
I even tried
<img src=@path alt="image" />
Still it doesn't take the value from variable.