asp.net mvc 4 - Alternative to sending data to view in List? -
i learning .net mvc , finished first application. @ minute trying send multiple list of data view, each list mulitple fields , populating multiple tables these lists. example have animals table in db, want pull records table , display of them in table in view. have db treatment table , want display records table in separate unrelated table in view
in past have declared list in viewmodel (below) , populated list required, not useful takes 2 fields, value, , text
public ienumerable<selectlistitem> treatmentlist { get; set; }
im not sure if have made problem clear. appreciated
thanks
you may consider 2 approaches:
using viewbag store ienumerable, not need put in view model
you may consider use select list
public selectlist treatmentlist { get; set; }
Comments
Post a Comment