Good Day All

i have an asp.net 4.5 application. i have hosted it on IIS 7.5 in Windows Server 2008. My application has different folders within it and some are for JS and some are for CSS and etc.. and they are inside a directory named "Shared" in my problem and most of the things especially the css , images etc they are reference like this

 <link href="../Shared/assets/css/bootstrap.css" rel="stylesheet"/> 
 <link rel="apple-touch-icon" sizes="57x57" href="../Shared/assets/ico/apple-touch-icon-57x57.png">

now when i host this Project i have issues with CSS and images because they are not retrieved. i use Fiddler to check what is happening and i realised that after i hosted the application now Fiddler reports a 404 error on the following path

** http://myiisreserver/Shared/assets/css/bootstrap.css**

there are many of them , this is just an Example. now you can see it it can see the server , but instead of adding my Application or website name , it add the Directory within my application. So basically it should look like this

http://myiisreserver/MyWebapplication/Shared/assets/css/bootstrap.css

What could be the Problem.

Thanks

I am not too fimilar with asp.net but with mvc I know that shared assets like this should be in the Content directory.

Sorry if this doesnt help much.

Its a simple path issue for the browser. the "../" is telling the browser to find this file by moving up to the parent directory, then accross to the Shared directory and continue the path listed. This is only going to work at the first level set of folders off the root. Once you get into a second level set of folders, this "../" path isnt going to work.

Another option is to provide the path off of the root. For example, if "shared" folder is a first level folder off the root, you can specificy this path from any page on your site regardless where the page is and the browser will be able to find the target page.

<link href="/Shared/assets/css/bootstrap.css" rel="stylesheet"/> 
 <link rel="apple-touch-icon" sizes="57x57" href="/Shared/assets/ico/apple-touch-icon-57x57.png">
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.