As an option it is nice to have javascript removed from aspx pages and put into .js files but if they sit in seperate location it may become difficult to manage them in visual studio as to which page is using which .js file.
if you want (pagename).aspx.js to be treated as a nested object like (aspx.cs) file you can use the following registry settings.
Add the below text to a settings.reg file and right click the file in windows explorer to find an option to "merge" menu option. Choose it to add settings to registry and restart visual studio to find the effect.
--------- settings.reg-----------------------
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\Projects\{E24C65DC-7377-472b-9ABA-BC803B73C61A}\RelatedFiles\.aspx\.js]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\Projects\{E24C65DC-7377-472b-9ABA-BC803B73C61A}\RelatedFiles\.ascx\.js]
--------------------------------------------
you may need to have LoadScriptsBeforeUI="false" in scriptmanager if you are using ajax in the same pages.
Happy scripting seperate in (pagename).aspx.js files.!