标签: asp.net-mvc razor
设置页面标题我有以下MVC视图语法
<title> Category : <% Model.CurrentModel ?? "All Models" %></title>
如果Model.CurrentModel为空,则将“类别:所有模型”写入页面标题。
Model.CurrentModel
我尝试使用与Razor View引擎相同的功能,但似乎无法正确使用。
答案 0 :(得分:4)
@(Model.CurrentModel ?? "All Models")
试试。