In Visual Studio (2008) is there a way to have a custom dependent file on another custom file?

Posted by rball on Stack Overflow See other posts from Stack Overflow or by rball
Published on 2009-04-07T22:52:25Z Indexed on 2010/04/28 6:33 UTC
Read the original article Hit count: 257

Instead of a *.cs code behind or beside I'd like to have a *.js file. I'm developing a MVC application an have no need for a code beside because I have controllers, but in certain cases it'd be nice to have a JavaScript code beside or some way to associate the file to the page it's being used on. I suppose I could just name them similarly, but I'm wanting to show the association if possible so there's no question about what the file is for.

Typically what I'm talking about is within Visual Studio now under your Global.asax file you will have a plus sign to the left:

+ Global.asax

Once you expand it you'll get

- Global.asax
    Global.asax.cs

I'd like the same thing to happen:

+ Home.spark

- Home.spark
    Home.spark.js

Updated:

My existing csproj file has a path to the actual file, not sure if that's screwing it up. I've currently got:

<ItemGroup>
    <Content Include="Views\User\Profile.spark.js">
      <DependentUpon>Views\User\Profile.spark</DependentUpon>
    </Content>
  </ItemGroup>
  <ItemGroup>
    <Content Include="Views\User\Profile.spark" />
  </ItemGroup>

and it's simply just showing the files besides each other.

© Stack Overflow or respective owner

Related posts about visual-studio

Related posts about visual-studio-2008