ASP.NET favicon.ico

I am tyring to get the favicon.ico to work on master pages.  I used the following code but the icon is not displaying on the tab.  How do i get this to work?

<head runat="server">

    <title>My Website</title>

    <link rel="icon" href="/favicon.ico" type="images/x-icon" />

</head>
LVL 2
CipherISAsked:
Who is Participating?
 
AshokConnect With a Mentor Commented:
Here are some notes form http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/Q_24596854.html

I am surprised that Mozilla, Chrome and Safari display the favicon.ico. They do not understand the Microsoft specific ICO format. Did you perhaps create a favicon.ico file that is actually a PNG, JPG or GIF? Because Microsoft browsers will not show that correctly.

To set this up well you need to:

1. Create an ICO file and a PNG (or JPG) file
2. Create one <link> for the ICO and one for the PNG
3. If your site is under a sub path (most are) you must often use a full link for Internet explorer.

For one of my blog sites http://www.undermyhat.org I solved it as follows.

Note that simply emptying your cache is not always enough for favicons. Your best bet in seeing this change in your browser is:

1. Go to about:blank and close all tabs
2. Empty all cache
3. Close the browser
4. Reopen and go to your page
0
 
AshokCommented:
After making this change, make sure to refresh BROWSER.

Right click on the icon.
Click on properties.
Click on “Details” tab.
Check “Bit depth” properties.
It should be “32” to display in IE 9.

I have done this for few websites, but have to look it up when I go home.

HTH
Ashok
0
 
AshokCommented:
For IE 7

in web.config

<staticContent>
            <clientCache cacheControlMode="NoControl" />
</staticContent>

HTH
Ashok
0
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

 
CipherISAuthor Commented:
it was already 32 bit depth
0
 
AshokCommented:
what is web browser's version?
0
 
CipherISAuthor Commented:
IE9 and Firefox 11.

BTW - above is not working
0
 
AshokCommented:
Make sure you create PNG file.

Renaming image file to .PNG will not work.
I think it should be PNG type image.

Ashok
0
 
Dave BaldwinFixer of ProblemsCommented:
This is the link on this page you're reading:  <link rel="shortcut icon" href="/images/experts-exchange/favicon.ico" type="image/x-icon" />

And this shorter form is what I use, works in all browsers:  <link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
0
 
AshokCommented:
follow this link

http://www.hypergurl.com/favicon.html

you may have to download & use IrfanView
0
 
AshokCommented:
file size of icon shoul not exceed 150 KB
0
 
AshokCommented:
Browser specific notes
Internet Explorer supports favicons since version 5.0. It is actually quite hard to make IE5 or IE6 show the favicon. If the icon is not showing, try one of the following:

Add the page to your favorites. If you already have the page in your favorites folder, remove it and add it again.
Make sure, the icon file is called favicon.ico and it is placed in the root folder of your web server.
Make sure, the path to the favicon in the header of your page is absolute, not relative.
Delete your temporary internet files. If the folder with temporary files has reached its maximum, the favicon may not be used.
If your favicon is still not showing, leave us a comment below.
Later versions of Internet Explorer improve support for favicons and it is

Frequent problems and solutions

If you have changed the icon on your web you see an old icon (or no icon) in your browser, refresh the page or clear the cache. If you do not know how to clear the cache and you still see the old icon, try testing your web from another computer. You can ask your pals on your favorite discussion board if they see your new favicon.
Do not rename .bmp to .ico. I really mean it. You need to convert picture to icon using one of the methods described above. While Firefox will accept this fake .ico, others may not.
Once more: if you can, have the favicon available on url www.yourserver.com/favicon.ico with correct headers. It will save you a lot of troubles. Test if your favicon is accessible by putting its url in the address box. It should either be displayed in the browser as picture or the download dialog should appear. If you see gibberish text instead, your web browser is not configured properly to handle .ico files.
Icons (.ico files) may contain multiple images with different sizes and different color depths. If your favicon contains multiple images and you only change one of them, you may not see the change in your browser, because it shows you a different image from the .ico file.
Favicons do not work in some browsers if you test them locally by opening a .html file (without a web server).
0
 
CipherISAuthor Commented:
my icon is an actual icon named favicon.ico.

It works with HTML
but it is now working in ASP.NET.
0
 
CipherISAuthor Commented:
I resolved it.  This is how I resolved it

    <link rel="icon" href="images/favicon.ico" type="image/ico" />

Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.