Which will be the better approach either use expando object or viewbag/viewdata ?
Current code :
Viewbag.List1 = context.getlist1();
Viewbag.List2 = context.getlist2();
Viewbag.List3 = context.getlist3();
Viewbag.List4 = context.getlist4();
ViewBag.string1 = string1;
ViewBag.string2 = string 2;
ViewBag.string2 = string 2;
I am trying to change code like
dynamic tempModel = new ExpandoObject();
tempModel .List1 = context.getlist1();
tempModel .List2 = context.getlist2();
tempModel .List3 = context.getlist3();
tempModel .List4 = context.getlist4();
tempModel .string1 = string1;
tempModel .string2 = string 2;
And pass tempModel to View.
tempModel .string2 = string 2;
And pass tempModel to View.
Laxmidhar SahooPosted Nov 13, 2018, 5:01 AM
Sunny BhorPosted Nov 13, 2018, 4:18 AM
In One object there can be 3 list of same model or there might be 5 list, sometimes there is empty set.
Sreekanth ReddyPosted Nov 13, 2018, 2:11 AM
Laxmidhar SahooPosted Nov 13, 2018, 1:32 AM
Sunny BhorPosted Nov 13, 2018, 1:26 AM
Laxmidhar SahooPosted Nov 13, 2018, 1:19 AM