title: MVC5 Html.RenderAction with different controller
body: <p>I am starting with MVC5 and created first project from <a href="http://www.asp.net/mvc/tutorials/mvc-5/introduction/getting-started">MVC5 Getting Started</a>.</p>
  
  <p>Now trying with Partial Rendering and added a method in MoviesController as below</p>
  
  <pre><code>[ChildActionOnly]
  public ActionResult PriceRange()
  {
     var maxprice = db.Movies.Max(m =&gt; m.Price);
     var minprice = db.Movies.Min(m =&gt; m.Price);
     ViewBag.MaxPrice = maxprice;
     ViewBag.MinPrice = minprice;
     return PartialView();
  }
  </code></pre>
  
  <p>It sets Min and Max price from Movies collection into ViewBag that are later displayed at view. I am trying to render it on different views.</p>
  
  <p>First i tried to render it at <code>Views/Movies/Index.cshtml</code> as below</p>
  
  <pre><code>@{Html.RenderAction("PriceRange");}
  </code></pre>
  
  <p>It works well there and results displayed correctly because it is using <code>MoviesController</code>, the same class where method <code>PriceRange</code> defined. </p>
  
  <p>Then i tried to render it at <code>Views/Hello/Index.cshtml</code> (this view is using <code>HelloWorldController</code>) with following code (first passing Action name then Controller name)</p>
  
  <pre><code>@{Html.RenderAction("PriceRange", "MoviesController");}
  </code></pre>
  
  <p>Here it is giving run-time error</p>
  
  <blockquote>
    <p>The controller for path '/HelloWorld/Index' was not found or does not implement IController.</p>
  </blockquote>
  
  <p>Here is complete code from Views/Hello/Index.cshtml</p>
  
  <pre><code>@{
      ViewBag.Title = "Movie List";
  }
  &lt;h2&gt;My Movie List&lt;/h2&gt;
  &lt;p&gt;Hello from our view template&lt;/p&gt;
  @{Html.RenderAction("PriceRange", "MoviesController");}
  </code></pre>
  
  <p>I found few examples through Google, they are calling RenderAction helper the same way, first passing Action name then Controller name.</p>
  
  <p>I couldn't understand what the wrong i am doing here.
  Can someone point out?</p>