“if” considered harmful in ASP.NET MVC View (.aspx) files?

后端 未结 7 1191
孤城傲影
孤城傲影 2021-02-10 05:47

I remember seeing a blog (or something) that said you should not use <% if ... %> in .aspx files in ASP.NET MVC, but I can\'t remember what it said the alternative is. Can a

7条回答
  •  离开以前
    2021-02-10 06:17

    I suspect that the point was an attempt to avoid spaghetti code rather than restrict the use of "if"s, here is a link to a Rob Conery blog about this, he does actually mention using helpers instead of Ifs so this may be what you saw ASP.NET MVC: Avoiding Tag Soup

提交回复
热议问题