How to display text in an MVC view with htmlattrbutes
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have the following code : @Html.ActionLink("Hello " + User.Identity.GetUserName() + "!", "Manage", "Account", routeValues: null, htmlAttributes: new { title = "Manage" }) I just want to display the text (with the correct htmlattribute) (i.e. no link ) Could you help me with the correct syntax please? 回答1: If i understand correctly,you want to show the text inside your link without an achor tag, but with your html attributes ( title attributes) Try this <span title="Manage">Hello @User.Identity.GetUserName() !</span> 回答2: I think you can