Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In your controller all you do is instantiate a new ClientModel object and add it to the list. Is that really what is in your index method? If so, the properties would be null and the issue is with your controller not your view. If not, could you post what your index method actually does? Also, in your ClientModel the property is CanaClie0012 so how does CanaClie0012.toList() come into play?</p> <h3>Update</h3> <p>I'm not sure how CanaClie0012 and Clientes0013 are related though I am assuming they are given that you are grouping them together within the ClientModel. For the sake of an example lets modify them by adding an id field in CanaClie0012 and a corresponding field in Clientes0013 so that we can join the two classes. Again, I'm only doing this to show what the controller might look like. So now we have the following.</p> <pre><code>public partial class CanaClie0012 { public string Id {get; set; } public string Client00130012 { get; set; } public string F1Pais00200012 { get; set; } public string F1Cana02530012 { get; set; } public string Direcc0012 { get; set; } public Nullable&lt;System.DateTime&gt; TmStmp0012 { get; set; } } public partial class Clientes0013 { public string CanaClie0012Id {get; set; } public string Client0013 { get; set; } public string Nombre0013 { get; set; } public string F1Pais00200013 { get; set; } } </code></pre> <p>Then your controller might look like.</p> <pre><code>public ViewResult Index() { using (var context = new MMProdatEntities()) { var lm = from cc in context.CanaClie0012 join c in context.Clientes0013 on cc.Id equals c.CanaClie0012Id select new ClientModel() { CanaClie0012 = new CanaClie0012() { Client00130012 = cc.Client00130012, F1Pais00200012 = cc.F1Pais00200012, F1Cana02530012 = cc.F1Cana02530012, Direcc0012 = cc.Direcc0012 }, Clientes0013 = new Clientes0013() { Client0013 = c.Client0013, Nombre0013 = c.Nombre0013, F1Pais00200013 = c.F1Pais00200013 } }; return View(lm); } } </code></pre> <p>Heck you do even do the following to confirm the issue is not view related by doing</p> <pre><code>public ViewResult Index() { List&lt;ClientModel&gt; lm = new List&lt;ClientModel&gt;(); ClientModel vm = new ClientModel() { CanaClie0012 = new CanaClie0012() { Client00130012 = "Client00130012 Data", F1Pais00200012 = "F1Pais00200012 data", F1Cana02530012 = "F1Cana02530012 data" }, Clientes0013 = new Clientes0013() { Client0013 = "Client0013 data", Nombre0013 = "Nombre0013 data", F1Pais00200013 = "F1Pais00200013 data" } }; lm.Add(vm); return View(lm); } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload