1

I have a ASP.Net 3.5 web site I developed on my old XP sp3 machine. The app uses Master Pages and App_Themes that include style sheet and images - and also an image folder off the main root for most of the images. There are also some javascript files in a /scripts folder for jQuery and one other. I now have a brand new Win 7 64-bit dev machine and I migrated the app there. It compiles and runs fine - even through the Enterprise Library hitting the SQL database - the only problem I am haveing is with the CSS and javascripot files. For some reason that I cannot detect they are not resolving when I run the app. The CSS does resolve at design time and all the styles are rendered correctly in the designer. This leads me to believe that it may be an IIS 7 issue?

Any help greatly appreciatged.

6
  • How are you referencing the CSS files (i.e. ../.. or full paths or...)? And, have you used a developer tool in the browser to see what path was sent to the browser relative to the path you expected? Commented Jan 2, 2010 at 16:52
  • It's almost certainly a paths issue. Can you post the rendered head of your document and the URL that you are hitting that page on. Also, can you hit the javascript/css files directly? Commented Jan 2, 2010 at 16:53
  • The style sheet is not referenced at all in the pages I am using themes in the web.config: <pages styleSheetTheme="Simple2"> The javascript is referenced like this: <script language="javascript" type="text/javascript" src="js/BrowserDetection.js"></script> These both worked on the old machine just fine. Commented Jan 2, 2010 at 17:00
  • I forgot to mention - but none of the image references are working either. ie <asp:Image ID="imgLogo" runat="server" ImageUrl="~/Images/Logo2.gif" /> no longer works. Commented Jan 2, 2010 at 17:03
  • You can use Firebug to check whether the file references are broken. This is, as the others already say, almost 100% a paths issue. Commented Jan 2, 2010 at 17:46

2 Answers 2

2

I have posted what seems to be the same problem in my blog along with the solution.

Funny Problem: Windows 7, IIS 7.5: Images, CSS not showing

check it out and mark this if correct, or comment otherwise.

Regards,

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

1 Comment

Thanks Mohamed - enabling Static Content in IIS 7.5 did the trick !
0

There are a number of possible causes.

First, check to make sure that the App_Themes folder, and its subfolders and files, have NTFS permissions that allow them to be accessed by IIS. Same for your images folder. You might need to double-check the AppPool settings to verify the Identity of the IIS user.

If that doesn't fix it, are you using impersonation? Or Windows Authentication?

You might also test the images folder permissions by trying to access the files directly from a browser, without relying on the <asp:Image> control; just key in a direct URL.

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.