Model是全局变量,一个页面一个
前台
@ModelWebApplication1.Models.Movie; @{ ViewBag.Title = "ModelTest"; }ModelTest@Model.ID@Model.Name@Model.Director
后台
public ActionResult ModelTest() { Movie movie=newMovie(); movie.Director = "haha"; movie.ID = "1"; movie.Name = "山有虎2333"; return View(movie); //这样塞进去 }