I just to add some model elemen value to Url.Content and don’t know how to do it.
Any clue?
Thank you!
Those lines don’t work…
<img alt="" src="@Url.Content("~/Images/Houses/@(house.ImageFileName)")" />
<img alt="" src="@Url.Content("~/Images/Houses/@house.ImageFileName")" />
<img alt="" src="@Url.Content("~/Images/Houses/" + @house.ImageFileName + ")" />
You don’t need the
@before yourhouseobjectsince you’ve already declared a code block with the first one at@Url. But this is the best way below.Assuming
houseis a validobjectin thecontext: