When using iis express no css applied on a remote pc

后端 未结 3 785
我寻月下人不归
我寻月下人不归 2021-01-03 11:50

I came up with a necessity to work with my asp.net mvc site from a remote pc while developing. So, I configured it to use IIS Express.

At first, a problem raised wit

3条回答
  •  长情又很酷
    2021-01-03 12:32

    It may be due to the error in resolving the root path where Css is located. You can try with Url helpers to resolve this issue.

    
    

    In Asp.net development server(In visual studio environments) will work fine.. but while hosting in IIS, root path cannot be resolved using a relative path. With the help of Url helpers we can resolve this issue. Using Firebug you can see the load error of resources if any.

    Edit:

    In the web.config under the section modify as follows.

     
      
     
    

    Give the proper values for username and password. You can try giving folder permission to the IIS user groups(IUSR ,IIS_IUSR) to the folder where application is hosted.(Right click the hosted folder -> Properties under the Security tab, you can find the user groups and can give permissions)

提交回复
热议问题