2

I am using asp.net with C# [3.5]. I want to display Image before my URL in browser, like IE and mozilla used to have. I want to display my custom image.

Please help. Thanks in advance

Zerotoinfinity
  • 6,290
  • 32
  • 130
  • 206
  • 1
    possible duplicate of [What is currently the best way to get a favicon to display in all browsers that support Favicons?](http://stackoverflow.com/questions/37073/what-is-currently-the-best-way-to-get-a-favicon-to-display-in-all-browsers-that-s) – Sean Bright May 10 '10 at 18:13
  • Have a look at http://stackoverflow.com/a/23553354/410937 which provides a comprehensive answer as well. I like placing the favicon in the root of the domain as to not have to add the link information. – atconway Mar 11 '15 at 02:54

4 Answers4

3

You're talking about a favicon. Not all browsers recognize it, but most do. You can add a link tag inside the head section of your HTML page with a link to the icon file:

<link rel="SHORTCUT ICON" href="http://www.example.com/myicon.ico"/>

More info here: http://en.wikipedia.org/wiki/Favicon

Ken Pespisa
  • 21,989
  • 3
  • 55
  • 63
  • It's forking in FF but not in IE, please help me how to display it in IE. Thanks a ton for your response. – Zerotoinfinity May 10 '10 at 18:32
  • 1
    IE doesn't look for it as often as FF does. Add the link to your favorites (in newer versions of IE this checks for the icon), or try a hard-refresh (Ctrl-F5). – John Sheehan May 10 '10 at 19:40
  • I tried it with IE 8, but all in vain ! :( I don't know why Microsoft is not looking for the enhancement of IE, it's not less with CS3. Anyways, Thanks a lot for your help. – Zerotoinfinity May 11 '10 at 17:24
2

You mean a favicon?

Create a 16x16 pixel image and use this tool to convert it to an .ico file: http://tools.dynamicdrive.com/favicon/

Then place this line in your <head> section:

<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
janhartmann
  • 14,713
  • 15
  • 82
  • 138
2

I do it like this in my asp.net page:

<link rel="shortcut icon" href="<%= ResolveUrl("~/Content/images/favicon.ico") %>"/>

Works in all major browsers including IE 7 and 8. Haven't tested 6. Note that this is just like Ken's answer but a not-fully-qualified path is generated. The browser sees this:

<link rel="shortcut icon" href="/Content/images/favicon.ico"/>
Christopher
  • 10,409
  • 13
  • 73
  • 97
0

do you mean a favicon?

Pharabus
  • 6,081
  • 1
  • 26
  • 39