Edit Html.ActionLink output string

为君一笑 提交于 2019-12-06 16:42:16

Aaron...Did you work this out?

I use Url.Action in the href attribute when I need something other than just the link text in the outputted HTML.

<a href="<%= Url.Action("About") %>" class="read-more">Read More<span class="arrow">→</span></a>

Hope this helps.

Cheers, -jc

You could write you're own HTML helper class and make it fit whatever needs you have. I've wrote a few before, I see the ones you get with MVC as just a start.

Here's a link with a tutorial. And here's and official MS video on how to.

If all you need is the arrow and you could use an image, you could use stylesheet to put that image after the link

.readmore-link{background-image: url('/image.png'); padding-right: 16px; /*...*/}

just tweak the image position etc.

Otherwise I'd recommend writing extension method for HtmlHelper.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!