How to add favicon.ico in ASP.NET site
- by Tapas Bose
The solution structure of my application is:
Now I am in Login.aspx and I am willing to add favicon.ico, placed in the root, in that page.
What I am doing is:
<link id="Link1" runat="server" rel="shortcut icon" href="../favicon.ico" type="image/x-icon" />
<link id="Link2" runat="server" rel="icon" href="../favicon.ico" type="image/ico" />
Also I have tried:
<link id="Link1" runat="server" rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<link id="Link2" runat="server" rel="icon" href="favicon.ico" type="image/ico" />
But these aren't working.
I have cleared the browser cache but no luck.
What will be the path to the favicon.ico from:
Login.aspx
Site.master
Thank you.
The login page's URL: http://localhost:2873/Pages/Login.aspx and the favicon.ico's URL: http://localhost:2873/favicon.ico.
I am unable to see the favicon.ico after changing my code as:
<link id="Link1" rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
<link id="Link2" rel="icon" href="/favicon.ico" type="image/ico" />