RazorMAn
RazorMAn

Reputation: 11

Favicon.ico not showing in the tab in asp.net mvc project

This is the code i call in _Layout.cshtml :

<head>
<link rel="icon" runat="server" [email protected]("~/myicon.ico")  type="image/ico" /> 
</head>

But icon don't show . I only get this default icon

favicon.ico

Upvotes: 0

Views: 964

Answers (1)

John M
John M

Reputation: 2600

I think you want Url.Content, not Url.Action

<link rel="icon" runat="server" [email protected]("~/myicon.ico")  type="image/ico" /> 

Url.Content resolves the path and returns the URL. Url.Action is used when you actually want to call a controller action and do something with the result.

Upvotes: 1

Related Questions