title: Share aspx page between projects
body: <p>We have a solution with multiple web projects, and there are some pages that should be present in several of them. So we'd need some sort of a shared project which contains aspx files, and which can be referenced by other web projects. </p>
  
  <p>Now there are a few implementations out there: </p>
  
  <p>One implementation <a href="http://weblogs.asp.net/scottgu/archive/2005/08/28/423888.aspx" rel="nofollow noreferrer">described by ScottGu</a> which involves building the shared project, and than copying the output aspx into the host project, and referencing the dll of the aspx. This method has the disadvantage that if the apsx gets modified it must been recopied.</p>
  
  <p>Another option, based on <a href="http://blogs.msdn.com/b/davidebb/archive/2005/10/31/turning-an-ascx-user-control-into-a-redistributable-custom-control.aspx" rel="nofollow noreferrer">David Ebbo's post</a> would be to convert the aspx into ascx-es which can be referenced as custom controls, and than include those custom-control-aspx-es into the host project inside of some placeholder pages. But my concerns are: can all apsx pages transformed into an ascx? I mean there's no Page.LoadComplete event in user controls for example.</p>
  
  <p>And yet another option is to use virtual directories that map into the shared webproject, as described in a Microsoft <a href="http://support.microsoft.com/kb/825996" rel="nofollow noreferrer">KB article</a>. The problem again with this method is that the shared aspx-es must be in predefined directories(that is the virtual directory).
  If the name of virtual directory overlaps a physical directory, the virtual overrides it and no pages from the latter can be used.
  Is it perhaps possible to merge these two together?</p>
  
  <p>Any thoughts? Thanks in advance
  P.S. How about debugging the shared pages?</p>