Solved

ASP.NET favicon.ico

Posted on 2012-03-26
13
624 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

919 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now