Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add logo in mvc layout?

I have this code in _Layout.cshtml

   <p class="site-title">@Html.ActionLink("your logo here", "Index", "Home")</p>

instead of "your logo here" I want to add the logo image.

like image 754
Naved Ansari Avatar asked Apr 13 '15 09:04

Naved Ansari


2 Answers

For that you have to make some changes like below.

<p class="site-title">
    <a href="@Url.Action("Index", "Home")">
        <img src="your/img/path.jpg" alt="" />
    </a>
</p>
like image 64
adricadar Avatar answered Sep 19 '22 12:09

adricadar


For MVC layout page, you can implement it, in this below mentioned way:

<div class="navbar-header">
            <div class="navbar-header pull-left">
                <a class="navbar-brand" href="@Url.Action("Index", "Home")">
                <img src="~/Images/Logo.jpg" alt="Site Logo" style="height:25px; width: 25px" /></a>
            </div>
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            @Html.ActionLink("Application Name", "Index", "Home", null, new { @class = "navbar-brand" })
</div>

You can style it, the way you want.

like image 26
Dark Matter Avatar answered Sep 19 '22 12:09

Dark Matter