7

I have provided <link rel="shortcut icon" href="~/Images/logo.gif" /> in my layout but i wish to replace the favicon on all the pages, even where layout is not used. I replaced the favicon file with my favicon (present in the root folder) still it loads the default favicon on pages without layout. What more needs to be changed in order to get my favicon. a similar but slightly different question has already been asked but isnt answered by anyone.link

1 Answer 1

14
  1. It's better to convert your .gif to .ico, you can do this online
  2. It's a convention to rename the icon to 'favicon.ico'

You can find more information on Wikipedia - look at the section 'How to use'

Your html should look like:

<link rel="shortcut icon" type="image/ico" href="~/Images/favicon.ico">

Check Mark Gravell's solution here

4
  • u can use gif image in mvc. it works in the pages using layout . it is rendered as ico only. i had placed favicon.ico in the root folder. it got solved just happend to be an issue with the server caching
    – Nikitesh
    Feb 3, 2014 at 11:38
  • favion.ico was in the cache i think, i cleared it and it took the new icon.
    – Nikitesh
    Feb 3, 2014 at 11:57
  • 1
    <Link is added to the _Layout file, in the head section.
    – usefulBee
    Jul 17, 2014 at 17:39
  • 1
    if you use razor syntax you should take care of defining the href part with href="@Url.Content("~/favicon.ico")"
    – pavemann
    Feb 3, 2016 at 10: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.