컨트롤러에서 호출하는 모델이 있기 때문에 webApp를 만들려고하고 충돌이 있습니다.하지만 컨트롤러가 동일한 컨트롤러에서 뷰를 변경할 때마다 내 모델을 다시 설정하고 초기 값을 다시 가져옵니다.두 개의 서로 다른 뷰에서 변수를 호출하는 방법
DataTable dt;
public AdminUsers()
{
dt = (new Userdb()).GetUsers();
}
public ActionResult Admin()
{
... // do whatever with dt before showing the results
return View(this.dt);
}
public ActionResult Results() // dt resets with the initial values
{
return View(this.dt);
}
수정 후보기간에 값을 유지하려면 어떻게해야합니까?
의 데이터 전송
POCO
를 사용해야합니다 (일반적으로 데이터베이스를하지만,'Session'은 옵션이 될 수 있음) 다음 –