Typically, in a web application, all code behind files such as
myNewPage.aspx.vb are compiled into a single DLL. the file
itself is no longer required at run-time, and it makes no difference when
copied to the output directory except exposing your code behind.
To do this without manually editing the project file, right click your
myNewPage.aspx.vb then select properties. Make
changes as in the following screen:
Build Action: None - The file is not included in the
project output group and is not compiled in the build process. An example
is a text file that contains documentation, such as a Readme file.
Copy to Output Directory - This property specifies the
conditions under which the selected source file will be copied to the
For more details, see VS2005 File Properties