jeudi 13 octobre 2016

Unexpected "foreach" keyword after "@" character. Once inside code, you do not need to prefix constructs like "foreach" with "@"

I am a beginner in .net I have an error in the following lines. I am not able to find out why the error actually arises.

@if(Model.FilteredDevice.Count()>0)
{
@foreach(FModel d in Model.FilteredDevice)
{
// other statements
}
}
else
{
<td> no text matching </td>
}

The complete error message is : An exception of type 'System.Web.HttpParseException' occurred in System.Web.WebPages.Razor.dll but was not handled in user code

Additional information: Unexpected "foreach" keyword after "@" character. Once inside code, you do not need to prefix constructs like "foreach" with "@".

Aucun commentaire:

Enregistrer un commentaire