Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 169001
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T12:33:11+00:00 2026-05-11T12:33:11+00:00

Instead of a *.cs code behind or beside I’d like to have a *.js

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T12:33:12+00:00Added an answer on May 11, 2026 at 12:33 pm

    Absolutely – but you’ll have to edit the project file by hand. Find your ‘child’ file’s entry, and change it to be a non-self-closing element, and add a child element to say what it depends on. Here’s an example for a .cs file being compiled:

    <Compile Include='AssertCount.cs'>   <DependentUpon>MoreEnumerable.cs</DependentUpon> </Compile> 

    And here’s a version I’ve just mocked up for the files you’ve specified – although I expect Home.spark will have an action associated with it rather than ‘None’:

    <ItemGroup>   <Content Include='Home.spark.js'>     <DependentUpon>Home.spark</DependentUpon>   </Content> </ItemGroup> <ItemGroup>   <None Include='Home.spark' /> </ItemGroup> 

    Visual Studio displays it just as you’d expect it to.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 131k
  • Answers 131k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Chained method calls are orthogonal to the ORM question, they're… May 12, 2026 at 6:11 am
  • Editorial Team
    Editorial Team added an answer OK, I found it. ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Range.Fields.Update May 12, 2026 at 6:11 am
  • Editorial Team
    Editorial Team added an answer One way to do this would be to create a… May 12, 2026 at 6:11 am

Related Questions

Instead of a *.cs code behind or beside I'd like to have a *.js
I'm working on a web site (not a web application) in VS 2008 .Net
Possible Duplicate: ASP.NET: Web Site or Web Application? I have noticed that there is
I'm concerned that the web hosting that I'm paying for is not configured correctly.
I have a new ASP.NET MVC project (my first), and I had been running

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.