Difference Between return View(), return Redirect(), return RedirectToAction() And RedirectToRoute() In MVC

There are different ways of rendering view in MVC. And many of us are confused about them in the beginning stage of journey as MVC programmers. Here I try my level best to clear up the confusion by explaining the concepts.

There are different ways of rendering view in MVC. And many of us are confused about them in the beginning stages of our journey as MVC programmers.
 
Here I try my level best to clear up the confusion by explaining the concepts.
 

return View()

 
It tells MVC to generate an HTML template to be displayed and sends it to the browser without making a new request. It does mean that it’s not changing the URL in the browser’s address bar.
  1. public ActionResult Index()  
  2. {  
  3.     return View();  
  4. }  

return RedirectToAction()

 
To redirect to a different action which can be in the same or different controller. It tells ASP.NET MVC to respond with a browser to a different action instead of rendering HTML as View() method does. Browser receives this notification to redirect and makes a new request for the new action.
  1. return RedirectToAction(“ActionName”,”ControllerName”);  
Or this can be written as
  1. return RedirectToAction(“~/ControllerName/ActionName”);  

return Redirect()

 
It also makes a new request for the new action but in order to use this method we have to specify the full URL.
  1. return Redirect(“ControllerName/ActionName”);  

return RedirectToRoute()

 
Redirect to action from the specified URL defined in the route table that is defined in RouteConfig file.
  1. return RedirectToRoute(“URLDefinedInMapRoute”);  
I hope this clears up the basic differences among these different ways of rendering view in MVC.