Response.Write vs <%= %>

后端 未结 15 2675
我在风中等你
我在风中等你 2020-12-28 14:34

Bearing in mind this is for classic asp

Which is better, all HTML contained within Response.Write Statements or inserting variables into HTML via &l

15条回答
  •  执念已碎
    2020-12-28 15:03

    <%=Bazify()%> is useful when you are generating HTML from a short expression inline with some HTML.

    Response.Write "foo" is better when you need to do some HTML inline with a lot of code.

    Technically, they are the same.

    Speaking about your example, though, the Response.Write code does a lot of string concatenation with &, which is very slow in VBScript. Also, like Russell Myers said, it's not tabbed the same way as your other code, which might be unintentional.

提交回复
热议问题