asp.net mvc - How to insert an image in ActionLink (View model) -
I want to display an image for every bike, but these codes are not working: < Pre> Anyone can help me with this, thanks a lot! I just updated my CSS file: There is no inbuilt HTML helpers for image hyperlinks. We have to make custom HTML to receive this requirement. So look at the links below, you will get an idea. Based on your comment. I give such solutions: Here I have given "blank" bikes if the bike is there. Name is empty or empty. & lt; Ul & gt; @wunch (bike bike in model.back) {& lt; Li & gt; @ Html.ActionLink (bike name, "categories", new {id = bike.id, name = bike.name, @ class = "picture"}, null) & lt; / Li & gt; } & Lt; / Ul & gt;
a.image {background: URL ('~ / store project (new) / store project / adventure / content / Images '') Any repeat center correct; Display area; Height: 84px; Width: 264px; }
@if (Convert.ToString (bike.Name) == Tap || Convert.tostring (bike name) == "") {bike.Name = "Empty"; } @ Html.ActionLink (convert .tostring ("bike"), "Categories", New {@id = bike.Id, @name = bike.Name}, New {@ class = "image"}) / Pre>
Comments
Post a Comment