From the MSDN help page.
1. Open a command window and navigate to the folder containing the .NET Framework.
The .NET Framework is installed in the following location.
%windir%\Microsoft.NET\Framework\version
2. Run the aspnet_compiler command, specifying the source as either a virtual path or physical path, the target folder, and a switch indicating whether you want to compile both code and .aspx pages (which is the default) or just code.
aspnet_compiler -v virtualPath targetPath
If your Web site is not an IIS application and therefore has no entry in the IIS metabase, use the following value for the -v switch.
aspnet_compiler -p physicalOrRelativePath -v / targetPath
If you want to precompile the site for deployment and update, include the -u switch, as shown in the following code example.
aspnet_compiler -p physicalOrRelativePath -v / targetPath -u
The targetPath parameter is a physical path.