我在 1 个控制器中有一个 List 对象,我想知道如何将它转移到下一个控制器,例如这就是我所拥有的
public ActionResult namelist()
{
var mynames = new List<everyname>
{
new everyname{ firstname ="john", Lastname= "henny"},
new everyname{ firstname = "bob", Lastname = "cosso"},
new everyname{ firstname = "bill", Lastname = "luther"},
new everyname{ firstname ="mike", Lastname= "jones"}
};
return View(mynames);
}
// how can i transfer the above list with information into this action below
public ActionResult newlist()
{
// i tried transfering the list here and it did not work
var namelist = new namelist()
IEnumerable<SelectListItem> items = namelist.Select(c => new SelectListItem
{
Value = namelist,
Text = namelist
});
我怎样才能转移东西?我迷失了这一点。