Code enclosed by <% ... %> is just executed, while expressions that include an equal sign, <%= ... %>, are evaluated and the result is emitted as content. Therefore <%="Hello World" %> renders the same thing as the C# code <% Response.Write("Hello World"); %>.

Note: For languages that use marks to end or separate statements (for example, the semicolon (;) in C#), it is important to place those marks correctly depending on how your code should be rendered.

C# code
<% Response.Write("Hello World"); %> A semicolon is necessary to end the statement.
<%="Hello World"; %> Wrong: Would result in "Response.Write("Hello World";);".
<%="Hello World" %> A semicolon is not necessary.

相关文章:

  • 2021-12-26
  • 2021-10-08
  • 2021-10-25
  • 2021-08-28
  • 2021-04-04
  • 2021-09-01
猜你喜欢
  • 2021-05-20
  • 2021-09-02
  • 2022-12-23
  • 2022-12-23
  • 2021-04-18
  • 2021-10-15
  • 2022-02-13
相关资源
相似解决方案