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?

Last updated:11/29/2014 6:42:21 AM

1 Answers

Kamlakar Singh
Kamlakar Singh

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>