Using Tempdata in ASP.NET MVC - Best practice
I am using ASP.NET MVC 3 to build a web application. What I am trying to do is pass values between two controllers, though there are many ways to do this I am particular interested in using TempData for this. public ActionResult Action1() { string someMessage; Test obj = SomeOperation(); if(obj.Valid) { someMessage = obj.UserName; } else { someMessage = obj.ModeratorName; } TempData["message"] = someMessage; return RedirectToAction("Index"); } public ActionResult Index() { ViewBag.Message = TempData["message"] return View(); } So is the use of TempData here correct ? I mean under best