public IActionResult Index() { ViewData["CurrentTime"] = DateTime.Now; ViewBag.TimeNow = DateTime.Now; var i = new Invite(); ViewBag.Name = "fred"; i.AreYouComing(ViewBag.Name); if (i.Rsvp) { return(View("Pass")); } return(View("Fail")); }
public IActionResult Index() { ViewData["CurrentTime"] = DateTime.Now; // only controller to view ViewBag.TimeNow = DateTime.Now; // only controller to view ViewBag.Name = ""; var i = new Invite(); i.AreYouComing("Fred"); if (i.RSVP) { ViewBag.Name = i.Name; return(View("Pass")); } return(View("Fail")); }
public IActionResult Index() { //Only goes from controller to view //Controller(data) ->View View(Rendering)->Controller ViewData["CurrentTime"] = DateTime.Now; ViewBag.CurrentTime = DateTime.Now; var i = new Invite(); ViewBag.Name = "fred"; i.AreYouComing(ViewBag.Name); if (i.Rsvp) { return(View("Pass")); } else { return(View("Fail")); } }