AjaxExamples.Controllers.SessionsController.Index C# (CSharp) 메소드

Index() 공개 메소드

public Index ( ) : System.Web.Mvc.ActionResult
리턴 System.Web.Mvc.ActionResult
        public ActionResult Index()
        {
            var sessions = _repository.FindAll();

            //for ajax requests, we simply need to render the partial
            if(Request.IsAjaxRequest())
                return View("_sessionList", sessions);

            return View(sessions);
        }