asp.net mvc - How to pass List from Controller to View in MVC 3. -


i have list<> binded data in controller action , want pass list<> view bind datagrid in razor view.

i new mvc.can 1 me how pass , how access in view.

thanks in advance,

balu

passing data view simple passing object method. take @ controller.view method

protected internal viewresult view(     object model ) 

something this

//controller  list<myobject> list = new list<myobject>();  return view(list);   //view  @model list<myobject>  // , property model type of list<myobject>  @foreach(var item in model) {     <span>@item.name</span> } 

Comments

Popular posts from this blog

How do you change vbulletin's home page to the forums instead of the default (CMS or Activity Stream)? -

c++ - Troubles when compiling phash program -