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

后端 未结 7 1206
孤城傲影
孤城傲影 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:09

    Is this the issue you're referring to?

    binding expressions can not be used in statement block <% %>, just as statements can not be used in a binding expression block <%# %>

    -- bruce (sqlwork.com)

    "Jason" <> wrote in message news:23C11F83-A2AA-406D-BDEC-...

    What is wrong with the following if statement in my aspx page?

    "T" Then%>

    I get error that says: BC30201: Expression expected.

    Bruce Barker

提交回复
热议问题