Pergunta

I am currently moving a site over to MVC with great success, but I have a couple of pages which have a mailto link on them. Is there a way to get this to work with Html.ActionLink?

Foi útil?

Solução

Html.ActionLink is meant to do just that, render a link to an action method URL; a mailto: link is a special case, a pseudo-protocol which is acted upon by the client's browser.

Just use a straight HTML anchor tag in your view, there's nothing wrong with doing that.

Outras dicas

  <a href="mailto:email@samplemeail.com?Subject=subject">LinkText</a>

With MVC model

 <a href="mailto:@Model.Email">E-mail</a>
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top