Support us .Net Basics C# SQL ASP.NET Aarvi MVC Slides C# Programs Subscribe Download

Part 165 - How to display an icon for website on browser tab

Suggested Videos
Part 162 - Binding asp.net treeview control to database table
Part 163 - Dynamically adding treenodes to treeview control
Part 164 - Displaying organization employee chart using treeview control



In this video we will discuss displaying an icon for an asp.net website on a browser tab. Let me explain what I mean. 



Navigate to http://www.Google.com, notice in the address bar an icon is displayed. 
how to display icon on browser tab

This icon is called favicon (short for Favorite icon). It is also known as a shortcut icon, Web site icon, tab icon or bookmark icon.

The size of the image should be 16 X16 pixels and it should be named favicon.ico. You can either create your own image or use many free websites that are available. http://www.favicon.cc is one such website. 

Once you have the image, place it in the root directory of your web application and include the following link in the head section of the page. If you have a master page, place it in the head section of the master page.
<link rel="shortcut icon" href="~/favicon.ico" type="image/x-icon"/>

If you are testing this on your local machine, make sure to use local IIS Web Server instead of built-in visual studio development server, otherwise the image will not be displayed.

No comments:

Post a Comment

It would be great if you can help share these free resources