Solved

ASP.NET favicon.ico

Posted on 2012-03-26
13
628 Views
Last Modified: 2012-04-03
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>
0
Comment
Question by:CipherIS
  • 8
  • 4
13 Comments
 
LVL 13

Expert Comment

by:Ashok
ID: 37766885
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
 
LVL 13

Expert Comment

by:Ashok
ID: 37766902
For IE 7

in web.config

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

HTH
Ashok
0
 
LVL 1

Author Comment

by:CipherIS
ID: 37766910
it was already 32 bit depth
0
Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
LVL 13

Accepted Solution

by:
Ashok earned 500 total points
ID: 37766922
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
 
LVL 13

Expert Comment

by:Ashok
ID: 37766930
what is web browser's version?
0
 
LVL 1

Author Comment

by:CipherIS
ID: 37767054
IE9 and Firefox 11.

BTW - above is not working
0
 
LVL 13

Expert Comment

by:Ashok
ID: 37767156
Make sure you create PNG file.

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

Ashok
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 37767166
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
 
LVL 13

Expert Comment

by:Ashok
ID: 37767184
follow this link

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

you may have to download & use IrfanView
0
 
LVL 13

Expert Comment

by:Ashok
ID: 37767202
file size of icon shoul not exceed 150 KB
0
 
LVL 13

Expert Comment

by:Ashok
ID: 37767232
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
 
LVL 1

Author Comment

by:CipherIS
ID: 37768280
my icon is an actual icon named favicon.ico.

It works with HTML
but it is now working in ASP.NET.
0
 
LVL 1

Author Comment

by:CipherIS
ID: 37768371
I resolved it.  This is how I resolved it

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

Thanks
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question