You can use ViewData [], but the best way would be to create a view class and return it.
, , , , "". View . :
public ActionResult Contacts(){
ViewData["contacts"] = arrayOfContacts[];
...
return View();
}
, :
public class ContactsView(){
Object[] ContactsList {get;set;}
}
public ActionResult Contacts(){
...
return View(new ContactsView(){
ContactsList = arrayOfContacts[];
});
}
, ContactsView. , :
... Inherits="System.Web.Mvc.ViewPage<ContactsView>" ...
, ...
Model.ContactsList
:
object[] arrayOfItems = (Object[])ViewData["theContactsList"];
, , , .. , . .