2010-02-01 59 views
2

在Visual Studio 3個文件通常組合在一起:Visual Studio的文件分組

  1. filename.aspx
  2. filename.aspx.cs
  3. filename.aspx.designer.cs

有沒有辦法添加另一個分組的文件,以便它可以摺疊並且不在視圖中?

  1. filename.aspx
  2. filename.aspx.cs
  3. filename.aspx.designer.cs
  4. customfile.cs

感謝

回答

3

如果打開的.csproj文件,你會看到它是如何完成的。嘗試按照該模式添加新文件。

例如:

<Compile Include="Default.aspx.cs"> 
    <DependentUpon>Default.aspx</DependentUpon> 
    <SubType>ASPXCodeBehind</SubType> 
</Compile> 
+0

神奇 - 愛它! – Daniel 2010-02-01 22:33:29

+0

@John:感謝您的編輯。 – 2010-02-01 22:53:27

0

下面是XML(對應於示例)

<Compile Include="customfile.cs"> 
    <DependentUpon>filename.aspx</DependentUpon> 
</Compile> 

就像一個魅力。