How do you set the title attribute of an ASP.NET MVC Html.ActionLink to the generated URL

Posted by Keith Hill on Stack Overflow See other posts from Stack Overflow or by Keith Hill
Published on 2010-12-21T22:21:53Z Indexed on 2010/12/22 5:54 UTC
Read the original article Hit count: 222

Filed under:
|

I would like users to be able to see the corresponding URL for an anchor tag generated by Html.ActionLink() when they hover over the link. This is done by setting the title attribute but where I'm stuck is figuring out how to get that value:

@Html.ActionLink(@testrun.Name, "Download", "Trx", 
                 new { path = @testrun.TrxPath }, new { title = ??)

How can I specify the URL that ActionLink is going to generate? I could hardcode something I guess but that violates DRY.

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about actionlink