I have the following code
public ActionResult Index()
{
ViewData.Model = new Model();
return Action1();
}
public ActionResult Action1()
{
return View();
}
When I called the index action, it will call action1 method, and then call the index action again. Anyone knows why is this behaving this way?
I know we can use RedirectToAction(“Action1”) to solve this, but I’m just curious the reason behind this behaviour. Thanks heaps.
RWendi
It does not call the
Indexaction again. Because the action you invoked at the first time wasIndexthe methodView()will return the view corresponding toIndex. That is why you see the view forIndex.