Action/RenderAction:-

Action and RenderAction are similar to the Partial and RenderPartial helpers. The Partial helper typically helps a View to render a portion of a view’s model using view markup in a separate file.

Action, on the other hand, executes a separate controller action and displays the results. Action Offers more flexibility and re-use because the controller action can build a different model and make use of a separate controller context.

Controller:

             
        public class MyController : Controller
        {
            public ActionResult Index()
            {
                return View();
            }
            [ChildActionOnly]
            public ActionResult Menu()
            {
                var menu = GetMenuFromSomewhere();
                return PartialView(menu);
            }
        }

     
            

The Menu action builds a menu model and returns a partial view with just the menu:

             
<ul>
@foreach (var item in Model.MenuItem) {
<li>@item.Text</li>
}
</ul>
     
            

In your Index.cshtml view, now you can call the Menu action to display the menu:

             
<html> 
<head><title>Index with Menu</title></head>
Rendering Helpers x 117
<body>
@Html.Action("Menu")
<h1>Welcome to the Index View</h1>
</body>
</html>
     
            

Notice that the Menu action is marked with a ChildActionOnlyAttribute. The attribute prevents the runtime from invoking the action directly via a URL. Instead, only a call to Action or RenderAction can invoke a child action.