1

Is there a built in way to change the favicon for different themes? If not would it be as simple as creatign a custom control to emit the link tag with the correct url to the icon?

Update

So based on what I have found in order to do this, it looks like I am going to have to create an http handler that will intercept all calls for favicon.ico.

This handler will then determine which theme we are using (in my case it will be based on the domain name), it will then output the themed favicon.ico from the various themes folders.

Since I am supporting IE7, I'm thinking this is the only option I have. Still curious if anyone else has a better way.

1

3 Answers 3

3

As long as your user is not using IE, that should be fine. IE (up to at least version 7) only reads the favicon.ico file and completely ignores the link tag.

2
  • your kidding! I only support IE6 and up :-(
    – JoshBerke
    Feb 8, 2009 at 0:57
  • I noticed:-( I was playing around and IE also does some weird caching on the favicons...clearing my cache didn't seem to get rid of the fav icon very annoying. Guess I'll add on my to do list an http handler to do this...
    – JoshBerke
    Feb 10, 2009 at 19:45
0

After some research and thought It looks like the only way to do this and still support IE7 and earlier (I am not sure if IE8 updated support for favicon or not). Would be to dynamically serve the icon to do this you can do the following:

  1. Create and register an HttpHandler to process requests for FavIcon.ico
  2. Configure IIS to send requests for .ico files to ASP.Net (If your using IIS6 or earlier)
  3. Run the logic that you use to determine which theme and from that find the .ico your going to serve up, and send it to the browser.
0

Note that per W3Schools

http://www.w3schools.com/browsers/browsers_stats.asp

You should expect about 1/2 your users to be using IE.

1
  • Actually 100% of my users are using IE;-) since we are a paid site, although this will change at some point. Also those stats are skewed if I remember. Most people who viisit that site are technical.
    – JoshBerke
    Feb 10, 2009 at 4:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.