I have a loop in my razor view as
below
<div>
@foreach(var inmate in Model)
{
@inmate.inmateid
@inmate.inmateid
}
</div>
My Model is an IEnumerable of inmates
containing 2 inmate objects. But the
result I am getting in my browser is
6
6
7
7
Instead of
6
7
Please can someone tell me why this is
the case?
Thanks
1 Replies - 2879 Views - Last Post: 18 November 2012 - 09:10 PM
#1
Unexpected Result from foreach loop in MVC 3 Razor View
Posted 14 November 2012 - 08:16 AM
Replies To: Unexpected Result from foreach loop in MVC 3 Razor View
#2
Re: Unexpected Result from foreach loop in MVC 3 Razor View
Posted 18 November 2012 - 09:10 PM
it's doing exactly what you told it to do, showing the inmate id twice foreach inmate object in your Model
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote




|