This question already has an answer here:

When the following ASP.NET MVC 5 Razor code is used in a view

@(Model.cobrandingLogoList[i].isMine ? " class=\"logo-owner\"" : String.Empty)

The rendered output is


Edit: added screen capture of the output enter image description here

The same thing happens if I use

@(Model.cobrandingLogoList[i].isMine ? @" class=""logo-owner""" : String.Empty)

I was expecting this


What should be used to get the desired result?

Related posts

Recent Viewed