ASP.NET MVC 3 using Razor - use conditional expression together with the HTML output

前端 未结 1 865
别那么骄傲
别那么骄傲 2021-01-18 06:13

I\'ve been bugged with this for many days...(I\'m in process of studying ASP.NET MVC 3)

In this link -- Razor If/Else conditional operator syntax -- is said

1条回答
  •  被撕碎了的回忆
    2021-01-18 06:34

    @(item.Manager == null ? new HtmlString("unassigned") : new HtmlString( item.Manager.Name) )
    

    0 讨论(0)
提交回复
热议问题