You are pretty close, you just need parentheses to help MVC work where C # code ends.
<img src="EmpImages/@(item.EmpKey).jpg"
They are optional in all razor syntaxes, but in complex situations, the analyzer may get a little lost trying to guess if it is @(item).EmpKey.jpg, @(item.EmpKey).jpgor @(item.EmpKey.jpg), and the brackets allow you to be explicit about what you are after.
source
share