ОТКЛЮЧИТЬ АДБЛОК

ADBlock блокирует некоторый контент на сайте

ADBlock errore

how to insert image in html action link? asp.net mvc

StackOverflow https://stackoverflow.com/questions/3627178

вопрос

I have navigation and many link on my webproject from html action links. They are ugly with underline. I would like to insert some image with name or play with styles of action link. Is it possible? How to do that?

Thanks and take care, Ragims

Решение

?? ?????? ???????????? CSS, ????? ??????? ????????????? ??? ????????? BackgroundImage, ? ????????? ?????? ?? ????? ?????? ?????? ??????? ??????, ??? ???:

<a href="<%: Url.Action("Action", "Controller")%>"><img src="yourimg.jpg" /></a>

ДРУГИЕ СОВЕТЫ

Html.ActionLink ? Url.Action ?????????? ???? ? ??? ?? URL. ??????? ??????????? ? ???, ??? ?????? ??????? HTML-???????, ? ?????? ?????????? ?????? URL ??? ????? ????????.

?????? ??????? ??????????? ? ????????????? Url.RouteUrl ??? Html.RouteLink, ????? ??????? ?????? ?? ?????? ? ?????? ???????? (? ????????), ? ?? ??????????????? ? ????????.

????? ?? ??????? ???????? ???????? ?????? ?????????? HtmlHelper ??? ???????? ?????? ???????? ??????????? ???????????. ????????? ??????????? ????? ????? .

???? ?? ?? MVC 3-4 ? ????? ????????? ???????, ?? ??? ????? ?????? ??? -

@Html.ActionLink("your link Name", "Action Method", "Controller", 
        new { style = "background-image:url('.././Images/imageyouwanttoshow.png')" },null)

?????? ????????????? @Html.ActionLink("linkname","action","controller") ?? ?????? ???????????? ?????????

<a href='@Url.Action("action", "controller")'>
<img src='@Url.Content("~/images/imageName.png")' />
«???????????» ??? ????? ??? ???????? ???????????. @Url.Content() ?????? ????? ????. ?? ?????? ???????? ???? ???????? ? ?????????? ??? ????? ???????? ?? @Url.Action(). @Url.Action() ???????? ?????????? @Html.ActionLink(). ?????? ???? ?????? ????? ???????? ?????????? ????????????.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow