Hi i need to show a list of data using viewbag.but i am not able to do it.
Please Help me..
I tried this thing:
ICollection list = ne
i had the same problem and i search and search .. but got no result.
so i put my brain in over drive. and i came up with the below solution.
try this in the View Page
at the head of the page add this code
@{
var Lst = ViewBag.data as IEnumerable;
}
to display the particular attribute use the below code
@Lst.FirstOrDefault().FirstName
in your case use below code.
@Lst.FirstOrDefault().FirstName
Hope this helps...