What is the difference between <% %> and <%=%>?

前端 未结 4 2330
庸人自扰
庸人自扰 2020-11-29 01:41

What is the difference between <% %> and <%= %> in ASP.NET MVC? And when to use which?

4条回答
  •  心在旅途
    2020-11-29 02:05

    <%= %> writes to the output stream (usually html) while <% %> is for executing arbitrary script code.

提交回复
热议问题