Checking if the value of type DateTime is null in view and showing blank if null

后端 未结 4 845
隐瞒了意图╮
隐瞒了意图╮ 2020-12-20 23:46

From my controller I have passed value module to view

    public ActionResult Details(long id, string owner)
    {
        var module = _ownedModuleRepositor         


        
4条回答
  •  一向
    一向 (楼主)
    2020-12-21 00:23

    Won't a ternary operation work here:

    @(Model.End != null ? Model.End.ToString() : "")
    

提交回复
热议问题