I read in Stephen Sanderson's book about ASP.NET, and I reached a point where I really got confused.
Work
@foreach (var link in Model) { @Html.RouteLink(link, new { controller = "Product", action = "List", category = link, page = 1 }); }
Does not work
@foreach (var link in Model) { Html.RouteLink(link, new { controller = "Product", action = "List", category = link, page = 1 }); }
(The difference is the first character inside the block)
In both scenarios, Razor gets this code, not markup (HTML), so why did I have to put the @ symbol at the beginning? What is the difference and what am I missing?
Edit:
I have to clarify what is not working. This menu and link is the current category. Now it works fine with @ , and you can see links to categories, but without it, as if there are no categories .. you donβt see anything.
source share