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 8877867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T19:34:20+00:00 2026-06-14T19:34:20+00:00

If .js files and css file are in view folder then they are not

  • 0

If .js files and css file are in view folder then they are not getting served. ANy idea what fix is required to make them both work if residing in same folder.

Path : Views\Shared\Javascripts
       Views\Shared\abc.cshtml
  • 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. Editorial Team
    Editorial Team
    2026-06-14T19:34:22+00:00Added an answer on June 14, 2026 at 7:34 pm

    If you look in the ~/Views (or ~/Areas/<area name>/Views, if you are using areas) folder, you’ll notice a web.config that prevents any resources from being served from that location. While you could edit that web.config to allow your static assets to be served, I would strongly caution you against this.

    Instead, place the assets in another folder. By default MVC projects have a ~/Content and ~/Scripts folder (CSS/images and JS, respectively). I’d encourage you to just stick to those folders.

    Edited to reflect recent edit

    Say you have abc.js. Move it to ~/Scripts/abc.js. You can include that script in abc.cshtml like this:

     <script type="text/javascript" src="@Url.Content("~/Scripts/abc.js")"></script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If I have two css files: File 1: .colorme { background-color:Red; } File 2:
I'm combining some CSS files and writing them to a file in a separate
Is there a way to load external CSS files, like we load JS file
I'm trying to add .css and .js file in my HTML template files that
My CSS file is acutally a PHP file which is served with content-type text/css
We include the CSS file via standard HTML STYLE tag. Then we need the
I have a CSS file being defined in my program and for some reason
I have a CSS file, which contain the style information of my web. Some
In my main CSS file, I have my a:link selector set to display links
I build a css file using PHP which allows me to easily customize the

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.