List value not populating in table in ASP.NET MVC

I am trying to learn ASP.NET MVC. I have created a .NET fiddle example. This is the URL:

I can not see ID and Name value in the table.

>Solution :

Seems like typo error. Just change to:

@foreach (var report in Model.Reports)
        <td><a href="#">@report.Name</a></td>

About the @ symbol see the following description from the Microsoft documentation:

Razor supports C# and uses the @ symbol to transition from HTML to C#.
Razor evaluates C# expressions and renders them in the HTML output.

Leave a Reply