public ActionResult Index()
{
var tickets =
DependencyContainer.DomainController.ShowTickets();
if(tickets==null)
{
ViewData.Add("Error","Associate not found");
return RedirectToAction("Index", "Home");//Doesn't fire the index?
}
return View();
home controller方法如下所示,仅在调试器启动时激发,如果我点击了f5,则在重定向后激发。
public ActionResult Index()
{
ViewData["Message"] = "Welcome to Home Loans and Insuring Technology Ticketing";
//if (TempData.ContainsKey(ErrorKey))
//{
// ViewData[ErrorKey] = TempData[ErrorKey];
// TempData.Remove(ErrorKey);
//}
return View();
}
重定向不会触发控制器?