IIS 7 Windows Server 2008 / CSS file not loading within aspx

前端 未结 3 1087
误落风尘
误落风尘 2021-02-10 09:19

I\'ve found out several topics related to this issue yet I couldn\'t find an answer which worked for my problem, which is following: I moved my Asp.Net 4.0 site to a new server

3条回答
  •  面向向阳花
    2021-02-10 10:00

    The articles/topics that you have found is talking about the same thing as Uali's answer, which is correct, but it doesn't always solve everyone's problem. The problem is also not about your css per se.

    Before proceeding, make sure that you have enabled Static Content as the other answer instructed.

    Then do these steps in the IIS Manager window with your virtual directory selected.

    1. Open Handler Mappings.
    2. Click Add Managed Handler in the Actions Panel located in the right.
    3. In the request path field, type: *.css
    4. In the type textbox, enter: System.Web.StaticFileHandler
    5. In the name textbox, type in any descriptive name you want such as css fix.
    6. Click OK.

    Update: I also forgot to say that you can do the same thing for .jpg, .png, .gif or any other file types if necessary.

提交回复
热议问题