Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 574 Vote(s) - 3.44 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to add favicon.ico in ASP.NET site

#1
The solution structure of my application is:

![enter image description here][1]

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:

[To see links please register here]

and the favicon.ico's URL:

[To see links please register here]

.

I am unable to see the favicon.ico ![enter image description here][2] 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" />


[1]:

[2]:
Reply

#2
Simply:

/favicon.ico

The leading slash is important.
Reply

#3
/favicon.ico
might do the trick<br/>
I have tried this on my sample website

<link rel="shortcut icon" type="image/x-icon" href="~/ows.ico" />

**Try this one in your site put the link in MasterPage,It works :)**

<link rel="shortcut icon" type="image/x-icon" href="~/favicon.ico" />
<br/>
I have tested in ,<br/>
**FireFox.**<br/>![enter image description here][1]<br/>
**Chrome.**<br/>
![enter image description here][2]
<br/>**Opera.**<br/>
![enter image description here][3]

**Some troubleshoots:**<br/>
1. Check if your favicon is accessible (correct url) ,goto view source and click on the favicon link
<br/>
2. Full refresh your browser by **Ctrl+F5** every time you make changes.<br/>
3. Try searching from SO you may find your related problem here.

<br/>**Some Links to help you out:**<br/>

[To see links please register here]

;

[To see links please register here]

;

[To see links please register here]

;


[1]:

[2]:

[3]:
Reply

#4
resolve the url like this `href="<%=ResolveUrl("~/favicon.ico")%>"`
Reply

#5
I have the same issue. My url is as below


[To see links please register here]


Below doesnot work

<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />

I got it to work like below

<link rel="shortcut icon" type="image/x-icon" href="/someapplication/favicon.ico" />
Reply

#6
@Scripts.Render("~/favicon.ico");
Please try above code at the bottom of your Layout file in MVC
Reply

#7
<link rel="shortcut icon" href="@Url.Content("~/images/")favicon.ico" type="image/x-icon"/ >

This works for me in MVC4 application favicon image is placed in the images folder and it will traverse from root directory to images and find favicon.ico bingo!
Reply

#8
for me, it didn't work without specifying the MIME in web.config, under `<system.webServer><staticContent>`

<mimeMap fileExtension=".ico" mimeType="image/ico" />
Reply

#9


<!-- begin snippet: js hide: false console: true babel: false -->

<!-- language: lang-html -->

<link rel="shortcut icon" type="image/x-icon" href="~/favicon.ico" />

<!-- end snippet -->

This worked for me. If anyone is troubleshooting while reading this - I found issues when my favicon.ico was not nested in the root folder. I had mine in the Resources folder and was struggling at that point.
Reply

#10
Just make sure your favicon.ico is 16x16, 32x32, 48x48 or 64x64 ...
506x478 for example will not work.
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through