ASP.NET MVC 4, List Course and Language on same View -
i have simple view, without model in it, want display course on course table , language list languages table.
both table not connected each other, in webform using usercontrol result, in mvc not able result want.
any tutorial great.
regards
- you should query database retrieve 2 collections.
 - create view model object 2 properties hold 2 collections.
 - then pass object view.
 - in view create html table each collections
 
a viewmodel class have need in view. in case:
public class myviewmodel{    public list<course> mycourses { get; set;}    public list<language> mylanguages { get; set;} }    in controller action, can call database logic have retrieve collections, instanciate viewmodel, , pass view.
Comments
Post a Comment