Last post Nov 09, 2017 05:35 AM by zxj
Nov 08, 2017 07:53 PM|BaaBaa_Malik|LINK
I have been working on a project where i have to select some data from models on the basis of their counts and then distribute that data to different lists (keeping whole model),
but when i have been referencing my obtained result applied on model list, it hasn't been passing either to list / arrays / IEnumerable with the error :
Cannot convert Models to List / Arrays.
I found a solution to this and pass my obtained model with converting it to List and save this on every single index of Array depends on the data, but now when i have been rendering it to View via Viewmodel, i can't access my model items as they are in the
list which itself is in the Array.
Kindly tell me how to access attributes in the View.
I made this :
By pointing to any of above, i am getting like this :
And then pointing on it, i get my Models Items.
Nov 08, 2017 08:23 PM|DA924|LINK
Any index off an array or collection is zero base.
index 0 is item 1 in the collection and index 1 is the second item in the array or collection so on and so forth.
var name = Project.Items.Somemodel.Name;
Project.Items.Somemodel.Name = name;
To be honest, you make no sense here as to what you are trying to accomplish.
Nov 09, 2017 05:35 AM|zxj|LINK
What's your ViewModel like?
How do you fill ViewModel?
Please provide relevant code including Controller and View, it would help us understand the problem better.