I have a asp.net mvc web application an it uses some favicon.ico. Now when I move it to IIS 7, as an application, the favicon stops being presented even when I try to enter the full address to the favicon. The icon is still there; the full address works in the browser to find the icon alone, but not within the applications master page. The code is standard and same as on some others of my apps, but there it works.
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title><asp:ContentPlaceHolder ID="TitleContent" runat="server" /></title>
<link rel="shortcut icon" href="../../Content/Images/favicon.ico" />
<link href="../../Content/Site.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../Scripts/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="../../Scripts/Site.js"></script>
</head>
Any ideas why this might be?
try changing your link tag to:
<link rel="shortcut icon" href="/Content/Images/favicon.ico" type="image/x-icon" />
Browsers are very finicky about favicons. They will not always retrieve them on a refresh and oftentimes they will skip them at will.
The best approach is to place your favicon in your document root so that tthe link is /favicon.ico
. Also make sure it is a real Microsoft format .ICO icon file. Looking it up through a path with parent directories ..
- like you do here - is asking for problems.
There is no formal cross server and browser standard, for more information see: http://en.wikipedia.org/wiki/Favicon
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With