title: Convert a single file aspx to code behind
body: <p>I'm working on a web site (not a web application) in VS 2008 .Net 3.5  and it uses the single file .aspx model where the server code is included in the head portion of the html instead of using a .aspx.cs code behind page.</p>
  
  <p>I'd like to quickly convert the files to use the code-behind model, but so far the only way I can do this is by removing the file, creating a new, code-behind aspx page of the same name, then manually copying in the aspx related code to the .aspx page and the server code to the .aspx.cs page.</p>
  
  <p>Is there a faster way to do this?</p>
  
  <p>I have seen two article that <em>seem</em> to answer this question, but unfortunately don't:
  <a href="http://msdn.microsoft.com/en-us/library/aa290385(VS.71).aspx#vstchworkingwithsingle-filewebformspagesinvisualstudioanchor5" rel="nofollow noreferrer">Working with Single-File Web Forms Pages in Visual Studio .NET</a> and 
  <a href="https://stackoverflow.com/questions/46938/how-do-you-convert-an-aspx-or-master-page-file-to-page-and-code-behind">How do you convert an aspx or master page file to page and code behind?</a></p>
  
  <p>Both offer a simple solution whereby VS does the leg work, you just point it to a file and shoot.  For whatever reason, they aren't working.  The first article seems to refer to VS 2002 and the second seems to refer to a web application.</p>
  
  <p>Is there any hope for a web site?</p>
  
  <p>Also, maybe I'm seeing this the wrong way, is there an advantage to the single page model?  I do plan on converting the whole web site to a web application soon, does the single page model work well in web applications?</p>