New to Razor and I am missing somethign simple here:
@foreach (var p in @Model)
{
<a href="/category/@Html.Display("CategoryID")" >
<img src="http://images.mydomain.com/productimages/@ViewData["ManufacturerID"]/category-@Html.Display("CategoryID")_lg.jpg?width=200&height=130" width="200" height="130" class="myImg" alt="" />
</a>
}
I simply want to out put the CategoryID here, the link above does not output a value for CategoryID. What am I doing wrong here?
My model is populated since I can drop this in the loop and it displays: @p.CategoryName
Try this.
We are using explicit expression inside the image source string (
@(p.CategoryID))