0

I have a visual studio project and some .aspx files in that project. The current structure is:

Project   
  Some Folder 
    Somefile.aspx
      Somefile.aspx.cs
      Somefile.aspx.designer.cs
    Somefile.js   
  Other files ...

I want to see my files as:

Project   
  Some Folder 
    Somefile.aspx
      Somefile.aspx.cs
      Somefile.aspx.designer.cs
      Somefile.js   <<<<< This file has bee tucked under .aspx file.
  Other files ...

How can I achieve this result?

Tom
  • 510
  • 1
  • 7
  • 24
  • I don't know why this has been downvoted. I inherited a project where I see the .js and .css files tucked under the .aspx file. I searched online to find out how it was done, but could not find out how. So, I resorted to this forum. I think its a fair question. Please comment as to why the downvote was necessary and I will make changes accordingly. Thank you. – Tom Apr 03 '15 at 16:17

1 Answers1

1

Add a DependentUpon node to the Content include tag in the project XML file. You'll have to manually edit it.

<Content Include="Default.js">
    <DependentUpon>Default.aspx</DependentUpon>
</Content>

Source: http://davefancher.com/2012/02/23/nesting-files-in-visual-studio/

There is also a registry-based solution here: Visual Studio 2010 related file nesting

Community
  • 1
  • 1
Barett
  • 5,826
  • 6
  • 51
  • 55