开发者

Image before URL in browser with asp.net

I am using asp.net with C# [3.5]. I want to display Image before my URL in browser, l开发者_StackOverflow社区ike IE and mozilla used to have. I want to display my custom image.

Please help. Thanks in advance


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


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


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


do you mean a favicon?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜