开发者

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

开发者 https://www.devze.com 2023-03-02 05:07 出处:网络
Setting a page title I have the following MVC View Syntax <title> Category : <% Model.CurrentModel ?? \"All Models\" %></title>

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

精彩评论

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