title: ASP.NET MVC ViewPage rendered in a ViewPage
body: <p>I'm wondering if it is possible to render a ViewPage inside of a ViewPage.</p>
  
  <p>Normally, you'd have this:</p>
  
  <pre><code>&lt;%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage&lt;my_object&gt;"%&gt;
  </code></pre>
  
  <p>and then in the page you can render a user control:</p>
  
  <pre><code>&lt;%Html.RenderPartial("~/Views/Shared/mycontrol.ascx", this.ViewData);%&gt;
  </code></pre>
  
  <p>However I'd like to render a ViewPage in a ViewPage. The reason? I'm working on a very large project with 10+ developers and a lot of code already written. A large piece is already written which dynamically renders the UI however there are 15+ methods which pass around a ViewPage.</p>
  
  <p>In other words, I'm calling this in the ViewPage:</p>
  
  <pre><code>&lt;%this.RenderUI();
  </code></pre>
  
  <p>And the method stub is this:</p>
  
  <pre><code>public static void RenderUI(this ViewPage viewPage)
  </code></pre>
  
  <p>So in order to reuse the most code, I'd like to pull the call to this.RenderUI() into it's own ViewPage but then include that on some ViewPages. It's a hairy situation and it sounds unnecessary, but there's a lot of code rework that would need to be done otherwise. Does anyone know if this can be achieved?</p>