In MVC 2 I have a user control - Partial page as below.
Model has four records
id Dtext Dtext1
1 A, A1
2 B B1
3 C C1
4 D D1
On My machine - Output is as above in the ID Order which is expected.
But after deployment output is totally bizarre something like below.
D D1
B B1
A, A1
C C1
Would like to know how data is sent or retrieved from ViewModel? Why not in the specific Order. Any idea.
I have downloaded MVC source code for investigation but don’t have any clue where to start?
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl< MyData>" %>
<% if (Model != null)
{
%>
<%
foreach (var item in Model)
{%>
<%: item.DisplayText %>
<%: item.DisplayText1 %>
<% }%>
<%} %>