title: How can I render the result of Html.Action() from within a custom helper?
body: <p>Due to an implementation detail, I have what would be a partial view that needs to be a full-fledged view "rendered" using <code>&lt;%= Html.Action(Model.ViewerToRender) %&gt;</code>. It works fine in my dev spike where I can put that line directly on the page, but in the production code it <strong>must</strong> be in a ViewPage helper method that returns a void. Given the <code>htmlString</code> variable in the following code, how can I render it to the page from within this helper?</p>
  
  <pre><code>public static void RenderDocumentViewer(this ViewPage&lt;DocumentViewModel&gt; page)
  {
      if(!page.Model.UseRenderPartial)
      {
          var htmlString = page.Html.Action(page.Model.ViewerToRender);
          // The following line is what I don't know how to do:
          page.RenderHtml(htmlString);
          return;
      }
  
      page.Html.RenderPartial(page.Model.ViewerToRender);
  }
  </code></pre>