I am trying add image in @Html.ActionLink using ASP.Net MVC
MVC Code:
@Html.ActionLink(linkText: "Image Text", actionName: "Index", controllerName: "Home", routeValues: null, htmlAttributes: new { @class = "addimg" })
CSS:
.addimg {
background-image: url("/assets/images/img3.png");
background-repeat: no-repeat;
width: 348px;
height: 65px;
}
what mistake am doing in code? without linktext cant create a ActionLink
Please give suggestions...
Thanks
5 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Ehsan SajjadPosted Jul 15, 2015, 9:59 AM
http://developmentpassion.blogspot.com/2015/07/image-actionlink-html-helper-in-aspnet.html
Ehsan SajjadPosted Jul 15, 2015, 9:57 AM
Munesh SharmaPosted Jul 15, 2015, 5:51 AM
VijayPosted Jul 15, 2015, 5:29 AM
Ehsan SajjadPosted Jul 15, 2015, 5:21 AM