Solved

ASP.NET favicon.ico

Posted on 2012-03-26
13
620 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
Comment Utility
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
Comment Utility
For IE 7

in web.config

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

HTH
Ashok
0
 
LVL 1

Author Comment

by:CipherIS
Comment Utility
it was already 32 bit depth
0
 
LVL 13

Accepted Solution

by:
Ashok earned 500 total points
Comment Utility
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
Comment Utility
what is web browser's version?
0
 
LVL 1

Author Comment

by:CipherIS
Comment Utility
IE9 and Firefox 11.

BTW - above is not working
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 13

Expert Comment

by:Ashok
Comment Utility
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 82

Expert Comment

by:Dave Baldwin
Comment Utility
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
Comment Utility
follow this link

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

you may have to download & use IrfanView
0
 
LVL 13

Expert Comment

by:Ashok
Comment Utility
file size of icon shoul not exceed 150 KB
0
 
LVL 13

Expert Comment

by:Ashok
Comment Utility
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
Comment Utility
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
Comment Utility
I resolved it.  This is how I resolved it

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

Thanks
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

771 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

11 Experts available now in Live!

Get 1:1 Help Now