Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Favicon Icon-MVC3 ASP.NET

What is the need of favicon.ico. I am trying to use MVC error handling and it complaines file being missed.How do get rid off this error.

Thanks

like image 572
Hari Gillala Avatar asked Jul 06 '11 12:07

Hari Gillala


4 Answers

Go to the RegisterRoutes method of the Global.asax.cs file, and add this, as one of the first lines:

routes.IgnoreRoute("{*favicon}", new { favicon = @"(.*/)?favicon.ico(/.*)?" });
like image 135
MartinHN Avatar answered Nov 15 '22 01:11

MartinHN


I suggest you use it, instead of getting rid of it. Cause it's part of the web standards in UI design. Don't you like branding of your site? Then this is a crucial part of that branding.

like image 36
Saeed Neamati Avatar answered Nov 15 '22 01:11

Saeed Neamati


Solution:

<link rel="SHORTCUT ICON" href="http://www.youraddress.com/youricon.ico"/>" if you use localhost then href="http://localhost:port/youricon.ico" Note:Use other name instead favicon.ico.

like image 43
Neno Avatar answered Nov 15 '22 03:11

Neno


Add the following to the beginning of your RegisterRoutes method:

routes.IgnoreRoute("favicon.ico");

Your browser will always ask the site for the favicon, this will ensure mvc doesn't try to resolve it.

like image 1
Timbo Avatar answered Nov 15 '22 02:11

Timbo