I have an asp.net mvc4 application. In which I have to insert an image with an URL for any action:
& Lt; / A & gt; But an invalid url error appears. So what is the reason for this error? How can I fix my code?
You can use in these ways
Method 1: >> @html.exelink ("retor", "retror", "client", blank, new {@ class = "background"}) CSS:
a.background {background: url (../ images / image.gif) No-repeat top left; Display area; Width: 150px; Height: 150px; Text indent: -9999 pixels; / * Link text * /} Method 2: & lt; A href = '@ url.Action hides ("MyAction", "Mac Controller") & gt; & Lt; Img src = '@ Url.Content ("~ / content / images / image.gif")' / & gt; & Lt; / A & gt; Method 3: @ HTMLActionLink ("Retor", "Retror", "Client", New { Style = "background: url ('../../content/images/image.gif') Any repeat center correct; Display: block; height: 24px; width: 24px;"}) < / Ex>
No comments:
Post a Comment