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

  • SEARCH
  • Home
  • 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

Related Questions

My code has something like this: HttpFileCollection files Instead of looping through each file
Instead of excluding it, by mistake, I deleted the .cs code behind file for
I have a C# code behind file that gets dynamically generated HTML from a
net/C# application I have list of items. In the code behind: I want to
I'm trying to rewrite code I've written in matlab in C++ instead. I have
I am using windows authentication in a ASP.Net Web Application and in the code-behind
I have a custom usercontrol with DataContext={Binding RelativeSource={RelativeSource self}} On the code behind i've
How can i change textbox BackColor in code-behind to something like this: Textbox1.BackColor =
I am databinding my gridview in VB code behind. Because of this I know
1)I have the PageBase class that inherits from Page Class. The all code behind

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.