The following sample code used to get Html.ActionLink to render as a button or an image instead of a link. To do this we just apply a CSS class to the htmlAttributes object. The following sample code also used for add/change logo for your asp.net MVC 4 projects.
To change your ASP.NET MVC 4 project logo just open the "_Layout.cshtml" find the following line
<p class="site-title">@Html.ActionLink("*****", "Index", "Home")</p>
<p>@Html.ActionLink("*****", "Index", null, new { @class = "site-logo" })</p>
a.site-logo {
background: url(../Images/header-logo.png) no-repeat top left;
display: block;
width: 100px;
height: 100px;
text-indent: -9999px; /* hides the link text */
}
If this post was help to you. Then Share this to your friends. Thanks!
4 comments:
Need to remove "background: none;" from
"site-title" class in Site.css then only it is working. Thanks for sharing the Info
thanks , it is working .
many thanks, nice and easy solution
its working
Post a Comment
Share your thoughts here...