0

I'm a little bit new to ASP.Net MVC, I started to migrate from WebForm to MVC but I faced with an issue in addressing in JavaScript or CSS files.

Imagine I have a sample.css file in which there is an address:

background: url("../image.jpg");

It works truly in WebForm since .. in WebForm takes address a level back but it in MVC address contains of controller and action so .. doesn't mean the same. Although it works sometimes.

How should I solve the matter? What is the right approach?

Muhammad Musavi
  • 2,512
  • 2
  • 22
  • 35

1 Answers1

0

I believe this answer will help you How to reference a .css file on a razor view? also search up bundling in MVC5

Andrei
  • 1,196
  • 1
  • 11
  • 25
  • Thanks for your replay, but all the samples in the given link, are placed in `.cshtml` file where Razor can acts, what I'm asking about is when it's inside `.css` or `.js` files. – Muhammad Musavi Oct 06 '19 at 06:52