I pass the object from the controller to the view. An object contains the Name, Title, and List of Event properties, such as List Events. You can link here (http://www.asp.net/mvc/tutorials/mvc-music-store-part-4). I am using ASP.NET MVC 3 / C # / and scripts
@model MvcEventCalendar.Models.Category @{ ViewBag.Title = "Browse"; } <h2>Browsing Category: @Model.Name</h2> <ul> @foreach (var event in Model.Events) { <li> @event.Title </li> } </ul>
The lines have a problem (@foreach (var event in Model.Events)) and (@ event.Title). Object events are not displayed in the Model. Similarly, the name is not displayed for the event. Intellisense doesn't display anything
Compiler Error Message: CS1513:} Expected
Source Error:
Line 8: Line 9: <ul> Line 10: @foreach (var event in Model.Events) Line 11: Line 12: {
source share