tags:

views:

72

answers:

4

Hi All,

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

+1  A: 

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">
meep
Yes ! Thanks for your reply
Zerotoinfinite
A: 

do you mean a favicon?

Pharabus
+1  A: 

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"/&gt;

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

Ken Pespisa
It's forking in FF but not in IE, please help me how to display it in IE.Thanks a ton for your response.
Zerotoinfinite
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
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.
Zerotoinfinite
+1  A: 

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"/>
Chris