开发者

MVC View syntax <% Model.CurrentModel ?? "All Models" %> as Razor view

Setting a page title I have the following MVC View Syntax

<title> Category : <% Model.CurrentModel ?? "All Models" %></title>

Which writes "Category : All Models" to a page title if Model.CurrentModel is null.

I've tried开发者_开发技巧 to use the same with Razor View engine, but can't seem to get it right.


@(Model.CurrentModel ?? "All Models")

Try that.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜