Why does this Razor syntax gives compilation errors?
Posted
by
dotnetN00b
on Stack Overflow
See other posts from Stack Overflow
or by dotnetN00b
Published on 2012-04-11T17:21:32Z
Indexed on
2012/04/11
17:29 UTC
Read the original article
Hit count: 171
I either get a "you need a ; here" or a "best overloaded match has invalid arguments" errors.
<tbody>
<tr>
@for (int i = 0; i < startDay; ++i)
{
@:<td><span></span><span></span></td>
}
@for (int j = startDay; j < ((numberOfDays + startDay) - 1); ++j)
{
<td>
<span>@startCount</span>
<br />
<span>
@{
var todaysEvents = Model.ToList().FindAll(d => d.CalDate.Day == j);
foreach(HTMLMVCCalendar.Models.CalendarModel eventsToday in todaysEvents)
{
foreach(HTMLMVCCalendar.Models.EventModel eventToday in eventsToday.CalEvents)
{
@eventToday.DayCode.ToString // error here
@:<br />
@eventToday.Subject // error here
@:<br />
@eventToday.EventDesc //error here
}
@:<br />
}
}
</span>
</td>
if ((j + 1) % 7 == 0)
{
@:</tr><tr>
}
@++startCount;
}
</tr>
</tbody>
© Stack Overflow or respective owner