4

What are these called in ASP.NET?

  • <%# ... %>
  • <%= ... %>
  • <%: ... %>

And what are the different variations? How are each of them used?

Sk8erPeter
  • 6,899
  • 9
  • 48
  • 67
Marc
  • 43
  • 1
  • 5

2 Answers2

3

The generic term for the tags like <% %> is "nuggets", with the exception of <%@ %> which is called a directive.

How each nugget is used can be found at .NET "code nugget blocks"?.

Community
  • 1
  • 1
Jimmy
  • 27,142
  • 5
  • 87
  • 100
2

That's a code block. The version with the # is used for data binding. They basically allow you to embed C# code into your aspx page.

MSDN has a good article on code blocks here, and a good article on data binding expressions here.

Abe Miessler
  • 82,532
  • 99
  • 305
  • 486