Have an application that I am trying to add custom icon to display in browser tab. Have the basic MVC ASP.NET template set up. Where do I set my custom ICON???? I have added it to favicon.ico in the root of directory and also added it in the properties of
the solution. When I run the app I continue to see just the default square box. What am I missing?
Please confirm you have put the picture in Images folder under root of directory . In addition , what is your browser for testing ? It won't work on localhost it using Edge :
Member
11 Points
37 Posts
Set ICON for Browser Tab
May 09, 2018 05:38 PM|1StormChaser43|LINK
Have an application that I am trying to add custom icon to display in browser tab. Have the basic MVC ASP.NET template set up. Where do I set my custom ICON???? I have added it to favicon.ico in the root of directory and also added it in the properties of the solution. When I run the app I continue to see just the default square box. What am I missing?
Star
8119 Points
2778 Posts
Re: Set ICON for Browser Tab
May 09, 2018 05:48 PM|vahid bakkhi|LINK
hi
you can use below code :
put the above code in your header
Please MARK AS ANSWER if suggestion helps.
Member
11 Points
37 Posts
Re: Set ICON for Browser Tab
May 09, 2018 07:13 PM|1StormChaser43|LINK
I have added that and it still doesn't work...
Member
11 Points
37 Posts
Re: Set ICON for Browser Tab
May 09, 2018 07:15 PM|1StormChaser43|LINK
@{
ViewBag.Title = "* Live *";
}
<html>
<head>
<link rel="shortcut icon" type="image/ico" href="/Images/storm-gps4.png">
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="refresh" content="60">
<title>@ViewBag.Title - Storm Command Center</title>
@Styles.Render("~/Content/css")
@Scripts.Render("~/bundles/modernizr")
//
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css">
//
<link rel="stylesheet" href="/resources/demos/style.css">
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script type='text/javascript' src='https://www.bing.com/api/maps/mapcontrol?key=&callback=loadMapScenario' async defer></script>
<script> <script src="https://code.jquery.com/jquery-1.12.4.js"></script> <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script> <script src="https://www.bing.com/api/maps/mapcontrol?key=&callback=loadMapScenario" defer="defer" type="text/javascript" async=""></script> <script></script>
All-Star
18815 Points
3831 Posts
Re: Set ICON for Browser Tab
May 10, 2018 06:50 AM|Nan Yu|LINK
Hi 1StormChaser43,
Please confirm you have put the picture in Images folder under root of directory . In addition , what is your browser for testing ? It won't work on localhost it using Edge :
https://stackoverflow.com/a/34047098/5751404
Best Regards,
Nan Yu
Contributor
5921 Points
2448 Posts
Re: Set ICON for Browser Tab
May 10, 2018 06:58 AM|KathyW|LINK
Not all browsers pick up the icon right away if they've already visited the site before you added it. What browser are you testing it with?
Star
8119 Points
2778 Posts
Re: Set ICON for Browser Tab
May 10, 2018 07:38 AM|vahid bakkhi|LINK
I thing your problem is here
First you must sure about your path.
If your image folder is in your root,try below
Please MARK AS ANSWER if suggestion helps.
Member
11 Points
37 Posts
Re: Set ICON for Browser Tab
May 10, 2018 01:24 PM|1StormChaser43|LINK
Images where in right directory. I was running Edge on Local Host. That was the problem. Thank YOU and have a nice day.