I have been working on my MVC 3 application and encountered some challenges with loading CSS, images, and JS files from the root folder. When I tried to run my view located in the Views folder, I faced the following output:
was used for CSS, and the following code for JS which unfortunately did not work:<link href="@Url.Content("~/RootFolder/styles.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/RootFolder/jquery-1.8.3.min.js")" type="text/javascript"></script>
- I made sure to add some configurations in my views Web.config file while troubleshooting this issue.
Despite these efforts, I was unable to load the CSS/images/JS files from the root folder. Interestingly, when I moved the cshtml file to the root folder where these files were located, everything worked perfectly. Can someone please assist me in resolving this dilemma?
Thank you in advance for your support :-)
UPDATE: The HTML code I am dealing with can be seen in the image below
My folder structure within the application is as follows: