MVC + IIS7 = CSS Issue

前端 未结 5 1325
Happy的楠姐
Happy的楠姐 2021-02-08 05:14

I have a web site running via IIS7 on Vista. The site is running on port 88, so http://localhost:88 should render the default /Home/Index view.

This works correctly, as

5条回答
  •  自闭症患者
    2021-02-08 06:08

    The problem not lies precisely in the authorization/authentication but in the modules that now manages the IIS. Inside system.webServer you should have runAllManagedModulesForAllRequests set to false so you can display all images/css without problems with authentication.

    In ASP.NET websites, the value of runAllManagedModulesForAllRequests previously had to be set to true to support routing. However, once IIS 7 has been updated with a Service Pack, the value of runAllManagedModulesForAllRequests can be set to false or omitted when working with ASP.NET routing.

    Ref. http://www.iis.net/configreference/system.webserver/modules

    P.S. Don't forget to add the following lines to the AppSettings section of my web.config file:

    < add key="autoFormsAuthentication" value="false" />

    < add key="enableSimpleMembership" value="false"/>

提交回复
热议问题