Referencing css and js in a virtual directory RRS feed

  • Question

  • User1909110561 posted

    OK, I just encountered a problem after moving a application to our 2 production servers.

    We have decided to start using a common look and feel for all of our applicastions so I came up with the idea of using a virtual directory where I would store css, js and images that each application would reference.  We just tested this new masterpage idea and it worked fine in our development and test envionments. But when we move to our production servers it fails.  The difference is our development and test servers are single server and we have 2 production servers. If you reference server1/appname or server2/appname everything looks and functions fine.  But if you reference app.domain.com then it ignores all the css and uses what was in the application folder

    This is how the previous developer handled referenced the css:

    <link href="<%=ResolveClientUrl("SharedResources/css/StyleSheet.css") %>" rel="stylesheet" type="text/css" />

    How would you handle this knowing you are referencing this from a website not essential a folder under the default web site?

    Monday, March 18, 2019 1:48 PM

All replies

  • User475983607 posted

    I would create a new IIS application under a subdomain. Then reference the CSS files from the application URL.  

    Monday, March 18, 2019 2:50 PM
  • User-1038772411 posted

    It was windows permission issue i move the folder thats it inherit wrong permissions. When i move to wwwroot folder and add permission to iis user it start working fine.

    Wednesday, March 20, 2019 1:28 PM