@model GRHModel.ListeDemandeConger
@{
ViewBag.Title = "AfficherMesDemandes";
Layout = "~/Views/Home/Common.cshtml";
}
<table class="table table-responsive" style="width:400px">
@foreach (var dc in Model.ldc)
{
<tr>
<td>
@Html.DisplayFor(i =>dc.DateDebut)
</td>
</tr>
}
</table>
Asked
Active
Viewed 364 times
-1

user9405863
- 1,506
- 1
- 11
- 16

karim merdessi
- 1
- 1
-
2Possible duplicate of [What is a NullReferenceException, and how do I fix it?](https://stackoverflow.com/questions/4660142/what-is-a-nullreferenceexception-and-how-do-i-fix-it) – Igor Mar 28 '18 at 16:43
-
where you are getting error? – user9405863 Mar 29 '18 at 03:51
1 Answers
0
You model is null. Surround your foreach with an IF checking if the model != null.
@if (Model != null)
{
your foreach
}

Rodrigo Werlang
- 2,118
- 1
- 17
- 28