Some sites like Cnn.com, Google, and MySpace have their own icons that show up on the URL TextBox of browsers, just to the left of http://. If you go to a site that doesn't have such an icon, the blank piece of paper with the top-right folded and the IE logo icon shows up as a default.
In regular HTML, how do we declare/specify the icon that shows up on a browser's URL TextBox? (Do you even do it in HTML?)
How do we do that in ASP.net?
Note: The icon I'm talking about also shows up on the tabs in IE 7.
You have to insert this line after the <head> tag in your html.
<linkrel="shortcut icon"href="images/MyComp.ico">
Make sure the image is file type .ico (for icon). Also, after inserting this line, the image may not appear immediately. Refresh the page by taking your mouse pointer to the little IE icon in the address bar (left most), click it and drag it outside the address bar (just a little bit so that you stay on the page) and then release it. This will refresh the page.
Heres an article for that:
http://msdn2.microsoft.com/en-us/library/ms537656.aspx
You must havefavicon.ico file in your root folder. You can generate your favicon.ico here:http://www.favicon.co.uk/
Is this an alternative way to associate your website with the icon? I'm not really following this one.
I went to the site and all it seems to do is to create a .ico file for you in the size you indicate, then you can download the file.
Does an ASP.net application then know about favicon.ico and to look for it in your root folder so that it'll render on people's browsers?
When you put favicon.ico in your root folder browser will show it. It doesn't matter if your web site is done with ASP.NET or you only have html pages. Only thing you have to add to your page is this:
<link rel="shortcut icon" href="http://links.10026.com/?link=favicon.ico">
I also just found out that if you're using master pages, the <link rel="shortcut icon" href="http://links.10026.com/?link=favicon.ico"> should be the master page file, and in the <head> tag of that master page file.
0 comments:
Post a Comment