Response.Write vs <%= %>

后端 未结 15 2674
我在风中等你
我在风中等你 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:00

    I prefer the <%= %> method in most situations for several reasons.

    1. The HTML is exposed to the IDE so that it can be processed giving you tooltips, tag closing, etc.
    2. Maintaining indentation in the output HTML is easier which can be very helpful with reworking layout.
    3. New lines without appending vbCrLf on everything and again for reviewing output source.

提交回复
热议问题