Bootstrap 3 Glyphicons are not working in window mobile - asp.net-mvc

Bootstrap 3 Glyphicons are not working in window mobile. They are working in other devices(Expect window phone)

As Mathew Hintzen has posted, the easiest way is to include the MIME specification in your web.config. Also, as he pointed out, this will cause 500 Internal Server Errors if you are using the Bundling of styles/scripts:
<configuration>
...
<system.webServer>
...
<staticContent>
...
<mimeMap fileExtension=".woff" mimeType="font/x-woff" />
</staticContent>
</system.webServer>
</configuration>
To answer the OP's question AND to fix the 500 Internal Server errors, include a 'remove' statement before setting the static content:
<configuration>
...
<system.webServer>
...
<staticContent>
...
<remove fileExtension=".woff" />
<mimeMap fileExtension=".woff" mimeType="font/x-woff" />
</staticContent>
</system.webServer>
</configuration>
This will load the font files on Windows Mobile / Internet Explorer Mobile (IE Mobile) AND the web server will continue to serve other bundled files to other browsers/clients.
I hope this helps. Happy Coding!

this is may because your Glyphicons font file is not responding from the server, add a MIME type like with [file name extension : .woff, MIME type : font/x-woff].
To add a MIME type ...
--->start
--->Internet Information Services manager (IIS manager)
---> select the site
--->add a MIME type like with [file name extension : .woff, MIME type : font/x-woff].

The easiest way is to include the MIME specification in your web.config as suggested by user2959178 in the comments above
<configuration>
...
<system.webServer>
...
<staticContent>
...
<mimeMap fileExtension=".woff" mimeType="font/x-woff" />
</staticContent>
</system.webServer>
</configuration>
WARNING: While this will fix the windows mobile, it CAN cause all other browsers to break with internal server errors of 500 if you are using the Bundling of Styles.

I have this issue as well.
My current solution is to use text fallbacks in buttons.
<button class="btn btn-default"><span class="glyphicon glyphicon-ok">
OK
</span></button>
It is not a design fix but it makes the product functional.
Note that we have tested several browsers on several different mobiles brands (ios, android, windows phone, firefox, chrome, IE 8, IE 11).
The problem only occurs on windows phone.
I have a Nokia Lumia 920 WIndows 8.
You can read a bit more on the bootstrap page for other documented fixes here: http://getbootstrap.com/getting-started/#browsers .

Related

Font failed to load on server?

both font works locally but on server elkwood works and avenir doesn't work i got no idea why. please see image
i also tried
font-family: "AvenirNextLTPro-Regular";
src: url( "/fonts/AvenirNextLTPro-Regular.otf" );
screenshot details
IIS does not know to serve the request for .otf files. We need to explicitly tell IIS that these are valid file types. To do that, Add this section to your web.config under <system.webServer> section.
<staticContent>
<mimeMap fileExtension=".otf" mimeType="font/otf" />
</staticContent>

Reducing the number of HTTP requests for cached resources

I have an ASP.NET MVC 4 application running in IIS 8.5 / Windows 8.1.
I enabled caching for pretty much everything.
I used YSlow plugin for Google Chrome to see the number of HTTP requests for Primed Cache.
I managed to reduce HTTP requests for javascript and css files, but don't know how to do the same for .png and .ico files.
I tried to add this section in web.config under system.webserver
<staticContent>
<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="1.00:00:00" />
<!-- Image types -->
<remove fileExtension=".jpg" />
<mimeMap fileExtension=".jpg" mimeType="image/jpeg" />
<remove fileExtension=".png" />
<mimeMap fileExtension=".png" mimeType="image/png" />
...
But that didn't work.
Any help would be greatly appreciated!
I've increased the cacheControlMaxAge value from 1.00:00:00 to 180.00:00:00 and that did the trick.

IIS Express - HTTP Error 500.19 0x800700b7 on 'mimeMap' for 'fileExtension' set to '.svg'

I was adding the ability to serve SVG & WOFF files to my Azure hosted web application. I found the following instructions:
https://blogs.iis.net/richma/archive/2014/01/07/adding-mime-types-to-your-windows-azure-web-site.aspx
Which I have followed by adding the below text to my Web.config file:
<staticContent>
<mimeMap fileExtension=".json" mimeType="application/json" />
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
<mimeMap fileExtension=".woff" mimeType="application/x-font-woff" />
</staticContent>
This works when published to Azure. However, now I get the following error from IIS-Express whenever I attempt to start up the website in Debug mode locally for every resource the website attempts to serve.
HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.
Detailed Error Information:
Module: CustomErrorModule
Notification SendResponse
Handler StaticFile
Error Code 0x800700b7
Config Error Cannot add duplicate collection entry of type 'mimeMap' with unique key attribute 'fileExtension' set to '.svg'
Config File snip\web.config
Requested URL http://snip:14466/resources/img/snip.png
Physical Path C:*snip*\Resources\img*snip*.png
Logon Method Anonymous
Logon User Anonymous
Config Source:
58: <mimeMap fileExtension=".json" mimeType="application/json" />
59: <mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
60: <mimeMap fileExtension=".woff" mimeType="application/x-font-woff"/>
It clearly hates my mimeMap for .svg but this works fine out in Azure Websites. Is there something I am missing for locally running these changes to the Web.config?
And of course I find this answer after already posting my question:
Adding <mimeMap> entry Causes 500 for Other Static Content on IIS Express
So the issue is that my local IIS configuration has the modules already loaded, meanwhile the production environment doesn't. So to fix the issue for both environments you need to make sure the mimeMaps are unloaded before loading them.
The code is the following for the fix:
<staticContent>
<remove fileExtension=".json"/>
<mimeMap fileExtension=".json" mimeType="application/json" />
<remove fileExtension=".svg"/>
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
<remove fileExtension=".woff"/>
<mimeMap fileExtension=".woff" mimeType="application/x-font-woff"/>
</staticContent>
Hope this helps others from wasting time looking for a fix.
I found that if you have any mimeMap items duplicated between your Web.Config in the directory hosting your app and the default %UserProfile%\Documents\IISExpress\config\applicationhost.config it will fail for them all.
Same solution worked: made sure to <remove> each <mimeMap> entry.

Orchard CMS 1.7 Custom Theme images not loading

I had started creating a new theme while using v1.6.1.
Things were not going well with a custom module creation so I decided to start from scratch. This time I am using the source from V1.7
I copied my custom theme folder, pasted it into the themes folder of the new 1.7 project and ran the site. I could see the theme in my dashboard so I set it to the current theme.
Now when I view my site NONE of the images are loading. The style sheets are loading, though none of the images - either from the style sheet or from any views - are loading.
My images are in myTheme/content/images - which as I understand it is how 1.6.1 required things to be laid out.
My content folder has a web.config as does my images folder. It's the same config used in 1.6.1 so I'm wondering if something has changed.
In one of my theme views I have the following code - this worked in 1.6.1:
<img src="#Url.Content(Html.ThemePath(WorkContext.CurrentTheme,"/Content/Images/phoneBullet.png"))" alt="T:" />
If I output this to my front-end I get:
~/Themes/PerformanceAbrasives/Content/Images/phoneBullet.png
This tells me things appear to be in the correct place - though I'm wondering if my web.config is now out of date?
I have this - there is a copy in content and a copy in images:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appSettings>
<add key="webpages:Enabled" value="false" />
</appSettings>
<system.web>
<httpHandlers>
<!-- iis6 - for any request in this location, return via managed static file handler -->
<add path="*" verb="*" type="System.Web.StaticFileHandler" />
</httpHandlers>
</system.web>
<system.webServer>
<staticContent>
<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="7.00:00:00" />
</staticContent>
<handlers accessPolicy="Script,Read">
<!--
iis7 - for any request to a file exists on disk, return it via native http module.
accessPolicy 'Script' is to allow for a managed 404 page.
-->
<add name="StaticFile" path="*" verb="*" modules="StaticFileModule" preCondition="integratedMode" resourceType="File" requireAccess="Read" />
</handlers>
</system.webServer>
</configuration>
Any pointers?
UPDATE
Ok... so if I set my project to use Visual Studios internal development server then all is well - if I tell it to use Local IIS Web server - use IIS Express (http://localhost:30333/) - then it doesn't work...
UPDATE 2
Ok - now running from IIS 7 and images do not load... stylesheets seem ok, but images are not.. grrr
any ideas so I don't run into this problem when I deploy?
Ok - I figured it....
You only need the web.config in my Content directory - not in both content AND images

How to use font-face to read font files in Umbraco?

I had my templates in simple HTML but when I put my templates, scripts and css in the Umbraco site. The fonts stopped being picked up.
At first I thought it was a path thing, but it wasn't. Whenever I try to type the URL of the referenced font I get an error.
Page not found No umbraco document matches the url
'localhost/.../bliss-heavy.otf'
umbraco tried this to match it using this xpath query'/root/*
[#urlName = "login"] | /root// [#urlName = "login"]')
I know my path is correct because when I try a slightly different path I get the obvious error:
Server Error in Application "LOCAL.DOTAGENCYLONDON.CO.UK"
Internet Information Services 7.5 Error Summary HTTP Error 404.0 - Not
Found The resource you are looking for has been removed, had its name
changed, or is temporarily unavailable.
In my web.config file I have:
<staticContent>
<remove fileExtension=".air" />
<remove fileExtension=".ttf" />
<remove fileExtension=".eot" />
<remove fileExtension=".svg" />
<remove fileExtension=".otf" />
<remove fileExtension=".woff" />
<mimeMap fileExtension=".air" mimeType="application/vnd.adobe.air-application-installer-package+zip" />
<mimeMap fileExtension=".ttf" mimeType="font/opentype" />
<mimeMap fileExtension=".eot" mimeType="application/vnd.ms-fontobject" />
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
<mimeMap fileExtension=".otf" mimeType="font/otf" />
<mimeMap fileExtension=".woff" mimeType="application/x-woff" />
</staticContent>
What should I look for now?
You first error looks like when you try to preview or browse to an umbraco page that has no template selected - go to the properties tab of the page and see if there is a template chosen:
#amelvin, thanks for your answer. That happens because I have no template or even node for the the /login.aspx URL.
But why was site being redirect to /login.aspx? It turned out that the app pool user didn't have permission to read the font files.
Once I overwrote the app pool credentials with mine in the IIS website, it was solved.

Resources