1

i use route

routes.MapRoute(
                "Search",
                "search/{categories}/{sections}/{actions}",
                new { controller = "home", action = "search", categories = 0, sections = 0, actions = string.Empty }
                );

sample : localhost:4304/search/64/0/0

Error (500 or 404) during loading resources because the way href="../../Content/Images/favicon.ico"

conducts not to localhost:4304/Content/Images/favicon.ico

but conducts to localhost:4304/search/Content/Images/favicon.ico (not found)

Problem with all resources (css, img, js)

1 Answer 1

3

It's not a good idea to reference your resource files like that. The best way is to spit out links to them with:

@Url.Content("~/Css/etc.css")

And if you have any images that you need from CSS, just put them in a folder under CSS (example: ~/Css/Images/myImage.jpg) so you can access them from CSS like this:

background-image: url(Images/myImage.jpg)

Now, that being said, the favicon.ico should be in the root of your website and nowhere else, do you have some other situation?

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.