This is caused by a feature of asp.net.
Any time a file changes in the directory where an application lives (virtual application, web root, etc) asp.net resets the application state and dynamically recompiles the pages. As a result any change (new or save) on a file type that .net watches (.dll, .as?x, web.config and others) will cause this reset to happen.
Depending on what you are doing there may be a better way to do it that doesn't include creating page and code behind files on the fly.
-
Peter