title: Get View outside Controller Context
body: <p>Is there any way to get the view of a Controller from another Controller ?</p>
  
  <p>For example i have my HelperController with several methods for the whole project and i have the function MontaCursosWall that is called on CursosController and this function needs to read a View that belongs to CursosController.</p>
  
  <p>In another case i need this same function (MontaCursosWall) that is called from a function inside HelperController to read the same View.</p>
  
  <p>I already have a code to read it but it's not working:</p>
  
  <pre><code>public string ToHtml(string pView, ControllerContext context)
  {
      using (var sw = new StringWriter())
      {
          var viewResult = ViewEngines.Engines.FindPartialView(context, pView);
          var viewContext = new ViewContext(context, viewResult.View, ViewData, TempData, sw);
          viewResult.View.Render(viewContext, sw);
          viewResult.ViewEngine.ReleaseView(context, viewResult.View);
          return sw.GetStringBuilder().ToString();
      }
  }
  </code></pre>
  
  <p>This is how i call it from the MontaCursosWall:</p>
  
  <pre><code>ToHtml(fileName, context).Split('|');
  </code></pre>
  
  <p>Where fileName is my View Name and context comes from the CursoController</p>