How to hide a div element depending on Model value? MVC

前端 未结 3 1165
情书的邮戳
情书的邮戳 2020-12-09 00:57

Here is what I have at the moment

 hidden=\"@(Model.IsOwnedByUser||!Model.CanEdit)\"

This works fine on Chrome but doesnt hide on Internet

3条回答
  •  醉话见心
    2020-12-09 01:18

    Your code isn't working, because the hidden attibute is not supported in versions of IE before v11

    If you need to support IE before version 11, add a CSS style to hide when the hidden attribute is present:

    *[hidden] { display: none; }
    

提交回复
热议问题