Glyphicons shows up fine in development but not when hosted in IIS

情到浓时终转凉″ 提交于 2019-12-05 00:07:03

问题


I am able to view my icons just fine when during development, however after creating the deployment package using visual studio's build deployment package, and hosting it on my local (same PC) IIS7.5 server, the icons do not show up. I just get a blank box for all of them

I checked the path, the images are there.

I googled around, and found someone with the same issue he had, but he was hosting his web project on apache, so what he did was to chmod all his files and folders to 777.

I kinda did the same in IIS7.5, I granted my folders read/write access but they're still not showing up. I did this via Handler Mappings > Content View > Edit Permissions. I gave the folder that had the glyphicons.png full control for ALL users just to be sure.

Still nothing shows up. What else is there to check?


回答1:


I was looking for the same answer and for me, worked when I put the link directly to site.

Try to use the links provided at http://glyphicons.getbootstrap.com/ or just put these in your _Layout page:

  • <link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet">

  • <script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>

  • <link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-glyphicons.css" rel="stylesheet">

Here are some other related links to similar situations:

  • Font Awesome not working, icons showing as squares

  • http://www.seankilleen.com/2012/12/how-to-quickly-update-mvc4-project-with.html

  • Bootstrap and font-awesome in MVC4




回答2:


FYI, this method suggested on this other StackOverflow answer resolves the issue by setting the Build action on the .eot, .ttf, & .woff files to "Content" instead of the default value of "None". Doing this resolved my issue.



来源:https://stackoverflow.com/questions/15213975/glyphicons-shows-up-fine-in-development-but-not-when-hosted-in-iis

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!