Search code examples
asp.nethtmlfavicon

Favicon is not dispaying on web page


I am not able to display a favicon on the webpage. I am using IE8. I have used the below markup in a .aspx page:

<head runat="server">
  <link rel="shortcut icon" href="Images/favicon.ico" />
</head>

I have kept the favicon.ico file in the Images.

It is displaying on other browsers like Firefox and Chrome, but I want it to be displayed on IE. What would be the settings to do in IE?


Solution

  • You cant take few actions:

    1. Set the link elements to runat=server
    2. Move the favicon.ico to the root (if you can).
    3. Use conditional comments to show the favicon for old IE
    4. Clear your browser cache.

    Code Result:

    <link runat="server" rel="shortcut icon" href="Images/favicon.ico" type="image/x-icon" />
    <link runat="server" rel="icon" href="Images/favicon.ico" type="image/ico" />
    <!--[if IE]>
    <link rel="shortcut icon" href="Images/favicon.ico" type="image/vnd.microsoft.icon" />
    <![endif]-->
    

    Further:

    Most browsers will pick up the favicon if you simply put it in the root folder, so that would be the best place to put it even if you also have a link tag that points to it.