Home > DeveloperSection > Forums > How to display text in an MVC view with htmlattrbutes
Takeshi Okada
Takeshi Okada

Total Post:89

Points:629
Posted on    November-28-2014 10:24 PM

 ASP.Net ASP.NET MVC  View 
Ratings:


 1 Reply(s)
 576  View(s)
Rate this:

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?



Kamlakar Singh
Kamlakar Singh

Total Post:194

Points:1396
Posted on    November-29-2014 6:42 AM

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>


Don't want to miss updates? Please click the below button!

Follow MindStick